]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
test: Check that strdup() does not fail
authorGuillem Jover <guillem@hadrons.org>
Sat, 27 Nov 2021 20:09:18 +0000 (21:09 +0100)
committerGuillem Jover <guillem@hadrons.org>
Sat, 27 Nov 2021 22:42:37 +0000 (23:42 +0100)
Warned-by: gcc
test/fgetln.c

index 2eafa8466126813cc8eaf33bc922f51ee147a364..e137fe76631a468b3a644ee1b1f35d8993020b3d 100644 (file)
@@ -96,6 +96,7 @@ test_fgetln_multi(void)
                char *str;
 
                str = strdup("A\n");
+               assert(str);
                str[0] += i;
 
                files[i].line_alloc = str;