- if (type < 0)
- return (CJ_CB_CONTINUE);
-
- endptr = NULL;
- errno = 0;
-
- if (type == DS_TYPE_COUNTER)
- vt.counter = (counter_t) strtoull (buffer, &endptr, /* base = */ 0);
- else if (type == DS_TYPE_GAUGE)
- vt.gauge = (gauge_t) strtod (buffer, &endptr);
- else if (type == DS_TYPE_DERIVE)
- vt.derive = (derive_t) strtoll (buffer, &endptr, /* base = */ 0);
- else if (type == DS_TYPE_ABSOLUTE)
- vt.absolute = (absolute_t) strtoull (buffer, &endptr, /* base = */ 0);
- else
- {
- ERROR ("curl_json plugin: Unknown data source type: \"%s\"", key->type);
- return (CJ_CB_ABORT);
- }
-
- if ((endptr == &buffer[0]) || (errno != 0))