src/utils_parse_option.c: Check for the terminating null-byte, too.
authorFlorian Forster <octo@noris.net>
Thu, 21 Aug 2008 07:38:18 +0000 (09:38 +0200)
committerFlorian Forster <octo@noris.net>
Thu, 21 Aug 2008 07:38:18 +0000 (09:38 +0200)
I was so focused on values with spaces, that I forgot to test trivial
cases :/

src/utils_parse_option.c

index 06e9f28..6ed2301 100644 (file)
@@ -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)
     {