From: Florian Forster Date: Thu, 21 Aug 2008 07:38:18 +0000 (+0200) Subject: src/utils_parse_option.c: Check for the terminating null-byte, too. X-Git-Tag: collectd-4.5.0~61 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=44c78181413e1e1a90d7512078fe8218b564271a;p=collectd.git src/utils_parse_option.c: Check for the terminating null-byte, too. I was so focused on values with spaces, that I forgot to test trivial cases :/ --- diff --git a/src/utils_parse_option.c b/src/utils_parse_option.c index 06e9f280..6ed2301f 100644 --- a/src/utils_parse_option.c +++ b/src/utils_parse_option.c @@ -100,7 +100,7 @@ int parse_option (char **ret_buffer, char **ret_key, char **ret_value) else /* an unquoted value */ { buffer = value; - while (!isspace ((int) *buffer)) + while ((*buffer != 0) && !isspace ((int) *buffer)) buffer++; if (*buffer != 0) {