X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_match.c;h=2aaeb963bc5451cb3f7c403e0edd75353be53701;hb=27cd1bfc12b4c3c81ccd2d3f2cc1f6ef5028a94f;hp=bdbad3f213155a544b8d06009aa90c7322e7522c;hpb=ec6204a39b67229bfb05b763d1ceea135150880d;p=collectd.git diff --git a/src/utils_match.c b/src/utils_match.c index bdbad3f2..2aaeb963 100644 --- a/src/utils_match.c +++ b/src/utils_match.c @@ -81,7 +81,7 @@ static int default_callback (const char __attribute__((unused)) *str, if (matches_num < 2) return (-1); - value = strtod (matches[1], &endptr); + value = (gauge_t) strtod (matches[1], &endptr); if (matches[1] == endptr) return (-1); @@ -129,7 +129,7 @@ static int default_callback (const char __attribute__((unused)) *str, if (matches_num < 2) return (-1); - value = strtoll (matches[1], &endptr, 0); + value = (counter_t) strtoull (matches[1], &endptr, 0); if (matches[1] == endptr) return (-1); @@ -160,7 +160,7 @@ static int default_callback (const char __attribute__((unused)) *str, if (matches_num < 2) return (-1); - value = strtoll (matches[1], &endptr, 0); + value = (derive_t) strtoll (matches[1], &endptr, 0); if (matches[1] == endptr) return (-1); @@ -184,7 +184,7 @@ static int default_callback (const char __attribute__((unused)) *str, if (matches_num < 2) return (-1); - value = strtoll (matches[1], &endptr, 0); + value = (absolute_t) strtoull (matches[1], &endptr, 0); if (matches[1] == endptr) return (-1); @@ -225,7 +225,7 @@ cu_match_t *match_create_callback (const char *regex, return (NULL); memset (obj, '\0', sizeof (cu_match_t)); - status = regcomp (&obj->regex, regex, REG_EXTENDED); + status = regcomp (&obj->regex, regex, REG_EXTENDED | REG_NEWLINE); if (status != 0) { ERROR ("Compiling the regular expression \"%s\" failed.", regex);