Просмотр исходного кода

Fixed possible crash in xs_regex_split_n().

grunfink 5 месяцев назад
Родитель
Сommit
df02bc02df
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      xs_regex.h

+ 1 - 1
xs_regex.h

@@ -58,7 +58,7 @@ xs_list *xs_regex_split_n(const char *str, const char *rx, int count)
     }
 
     /* add the rest of the string */
-    list = xs_list_append(list, p);
+    list = xs_list_append(list, xs_is_string(p) ? p : "");
 
     regfree(&re);