Browse Source

libgis parser: an empty string is not an answer (#958)

skip zero length answers
Markus Metz 4 years ago
parent
commit
fd835a5f09
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lib/gis/parser.c

+ 4 - 0
lib/gis/parser.c

@@ -1089,6 +1089,10 @@ void set_option(const char *string)
     *ptr = '\0';
     *ptr = '\0';
     string++;
     string++;
 
 
+    /* an empty string is not a valid answer, skip */
+    if (! *string)
+	return;
+
     /* Find option with best keyword match */
     /* Find option with best keyword match */
     key_len = strlen(the_key);
     key_len = strlen(the_key);
     for (at_opt = &st->first_option; at_opt; at_opt = at_opt->next_opt) {
     for (at_opt = &st->first_option; at_opt; at_opt = at_opt->next_opt) {