Changeset 076670c54ef9afec8e503951de3a3ed109d79405

Show
Ignore:
Timestamp:
07/14/11 16:21:35 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1310660495 -0400
git-parent:

[43d5801748ac0e85b438790c8fc94618caadd51d]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1310660495 -0400
Message:

they can be present but null, cope with that case

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_check_log.c

    rcfb6924 r076670c  
    290290 
    291291  metric->name = m->metric_name; 
    292   switch (m->metric_type) { 
    293     case METRIC_INT32: 
    294       metric->has_valuei32 = noit_true; 
    295       metric->valuei32 = *(m->metric_value.i); break; 
    296     case METRIC_UINT32: 
    297       metric->has_valueui32 = noit_true; 
    298       metric->valueui32 = *(m->metric_value.I); break; 
    299     case METRIC_INT64: 
    300       metric->has_valuei64 = noit_true; 
    301       metric->valuei64 = *(m->metric_value.l); break; 
    302     case METRIC_UINT64: 
    303       metric->has_valueui64 = noit_true; 
    304       metric->valueui64 = *(m->metric_value.L); break; 
    305     case METRIC_DOUBLE: 
    306       metric->has_valuedbl = noit_true; 
    307       metric->valuedbl = *(m->metric_value.n); break; 
    308     case METRIC_STRING: 
    309       metric->valuestr = m->metric_value.s; break; 
    310     default: 
    311       return -1; 
     292  if(m->metric_value.vp != NULL) { 
     293    switch (m->metric_type) { 
     294      case METRIC_INT32: 
     295        metric->has_valuei32 = noit_true; 
     296        metric->valuei32 = *(m->metric_value.i); break; 
     297      case METRIC_UINT32: 
     298        metric->has_valueui32 = noit_true; 
     299        metric->valueui32 = *(m->metric_value.I); break; 
     300      case METRIC_INT64: 
     301        metric->has_valuei64 = noit_true; 
     302        metric->valuei64 = *(m->metric_value.l); break; 
     303      case METRIC_UINT64: 
     304        metric->has_valueui64 = noit_true; 
     305        metric->valueui64 = *(m->metric_value.L); break; 
     306      case METRIC_DOUBLE: 
     307        metric->has_valuedbl = noit_true; 
     308        metric->valuedbl = *(m->metric_value.n); break; 
     309      case METRIC_STRING: 
     310        metric->valuestr = m->metric_value.s; break; 
     311      default: 
     312        return -1; 
     313    } 
    312314  } 
    313315  return 0;