diff options
Diffstat (limited to 'lib/perfdata.c')
| -rw-r--r-- | lib/perfdata.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/perfdata.c b/lib/perfdata.c index 2930a8bc..f4eaf843 100644 --- a/lib/perfdata.c +++ b/lib/perfdata.c | |||
| @@ -37,9 +37,9 @@ char *pd_to_string(mp_perfdata pd) { | |||
| 37 | if (strchr(pd.label, '\'') == NULL) { | 37 | if (strchr(pd.label, '\'') == NULL) { |
| 38 | asprintf(&result, "'%s'=", pd.label); | 38 | asprintf(&result, "'%s'=", pd.label); |
| 39 | } else { | 39 | } else { |
| 40 | // we have a illegal single quote in the string | 40 | // we have an illegal single quote in the string |
| 41 | // replace it silently instead of complaining | 41 | // replace it silently instead of complaining |
| 42 | for (char *ptr = pd.label; *ptr == '\0'; ptr++) { | 42 | for (char *ptr = pd.label; *ptr != '\0'; ptr++) { |
| 43 | if (*ptr == '\'') { | 43 | if (*ptr == '\'') { |
| 44 | *ptr = '_'; | 44 | *ptr = '_'; |
| 45 | } | 45 | } |
| @@ -393,7 +393,7 @@ mp_range_parsed mp_parse_range_string(const char *input) { | |||
| 393 | 393 | ||
| 394 | mp_range_parsed result = { | 394 | mp_range_parsed result = { |
| 395 | .range = mp_range_init(), | 395 | .range = mp_range_init(), |
| 396 | .error = MP_PARSING_SUCCES, | 396 | .error = MP_PARSING_SUCCESS, |
| 397 | }; | 397 | }; |
| 398 | 398 | ||
| 399 | if (input[0] == '@') { | 399 | if (input[0] == '@') { |
| @@ -436,7 +436,7 @@ mp_range_parsed mp_parse_range_string(const char *input) { | |||
| 436 | result.range.start_infinity = false; | 436 | result.range.start_infinity = false; |
| 437 | perfdata_value_parser_wrapper parsed_pd = parse_pd_value(input); | 437 | perfdata_value_parser_wrapper parsed_pd = parse_pd_value(input); |
| 438 | 438 | ||
| 439 | if (parsed_pd.error != MP_PARSING_SUCCES) { | 439 | if (parsed_pd.error != MP_PARSING_SUCCESS) { |
| 440 | result.error = parsed_pd.error; | 440 | result.error = parsed_pd.error; |
| 441 | free(working_copy); | 441 | free(working_copy); |
| 442 | return result; | 442 | return result; |
| @@ -457,7 +457,7 @@ mp_range_parsed mp_parse_range_string(const char *input) { | |||
| 457 | } else { | 457 | } else { |
| 458 | perfdata_value_parser_wrapper parsed_pd = parse_pd_value(input); | 458 | perfdata_value_parser_wrapper parsed_pd = parse_pd_value(input); |
| 459 | 459 | ||
| 460 | if (parsed_pd.error != MP_PARSING_SUCCES) { | 460 | if (parsed_pd.error != MP_PARSING_SUCCESS) { |
| 461 | result.error = parsed_pd.error; | 461 | result.error = parsed_pd.error; |
| 462 | return result; | 462 | return result; |
| 463 | } | 463 | } |
| @@ -470,7 +470,7 @@ mp_range_parsed mp_parse_range_string(const char *input) { | |||
| 470 | 470 | ||
| 471 | double_parser_wrapper parse_double(const char *input) { | 471 | double_parser_wrapper parse_double(const char *input) { |
| 472 | double_parser_wrapper result = { | 472 | double_parser_wrapper result = { |
| 473 | .error = MP_PARSING_SUCCES, | 473 | .error = MP_PARSING_SUCCESS, |
| 474 | }; | 474 | }; |
| 475 | 475 | ||
| 476 | if (input == NULL) { | 476 | if (input == NULL) { |
| @@ -501,7 +501,7 @@ double_parser_wrapper parse_double(const char *input) { | |||
| 501 | 501 | ||
| 502 | integer_parser_wrapper parse_integer(const char *input) { | 502 | integer_parser_wrapper parse_integer(const char *input) { |
| 503 | integer_parser_wrapper result = { | 503 | integer_parser_wrapper result = { |
| 504 | .error = MP_PARSING_SUCCES, | 504 | .error = MP_PARSING_SUCCESS, |
| 505 | }; | 505 | }; |
| 506 | 506 | ||
| 507 | if (input == NULL) { | 507 | if (input == NULL) { |
| @@ -548,7 +548,7 @@ perfdata_value_parser_wrapper parse_pd_value(const char *input) { | |||
| 548 | // try integer first | 548 | // try integer first |
| 549 | integer_parser_wrapper tmp_int = parse_integer(input); | 549 | integer_parser_wrapper tmp_int = parse_integer(input); |
| 550 | 550 | ||
| 551 | if (tmp_int.error == MP_PARSING_SUCCES) { | 551 | if (tmp_int.error == MP_PARSING_SUCCESS) { |
| 552 | perfdata_value_parser_wrapper result = { | 552 | perfdata_value_parser_wrapper result = { |
| 553 | .error = tmp_int.error, | 553 | .error = tmp_int.error, |
| 554 | .value = tmp_int.value, | 554 | .value = tmp_int.value, |
| @@ -558,7 +558,7 @@ perfdata_value_parser_wrapper parse_pd_value(const char *input) { | |||
| 558 | 558 | ||
| 559 | double_parser_wrapper tmp_double = parse_double(input); | 559 | double_parser_wrapper tmp_double = parse_double(input); |
| 560 | perfdata_value_parser_wrapper result = {}; | 560 | perfdata_value_parser_wrapper result = {}; |
| 561 | if (tmp_double.error == MP_PARSING_SUCCES) { | 561 | if (tmp_double.error == MP_PARSING_SUCCESS) { |
| 562 | result.error = tmp_double.error; | 562 | result.error = tmp_double.error; |
| 563 | result.value = tmp_double.value; | 563 | result.value = tmp_double.value; |
| 564 | } else { | 564 | } else { |
