Add corner case for string_fget_word when it doesn't end with a separator

This commit is contained in:
Patrick Pelissier committed 2020-06-19 21:10:46 +02:00
1 parent 44b3895698
commit 32b6f82249
1 file changed
+10
+10
View File
@@ -446,6 +446,16 @@ static void test0(void)
assert(b == false);
fclose(f);
f = fopen("a-mstring.dat", "wt");
assert(f != NULL);
fprintf(f, "word");
fclose(f);
f = fopen("a-mstring.dat", "rt");
b = string_fget_word(s1, " \t.\n?", f);
assert(b);
assert(string_equal_str_p(s1, "word"));
fclose(f);
size_t h = string_hash(s1);
assert (h != 0);