mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 12:31:52 -04:00
selftests/nolibc: Return correct value when printf test fails
Correctly return 1 (the number of errors) when strcmp() fails rather than the return value from strncmp() which is the signed difference between the mismatching characters. Signed-off-by: David Laight <david.laight.linux@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://patch.msgid.link/20260302101815.3043-4-david.laight.linux@gmail.com Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This commit is contained in:
committed by
Thomas Weißschuh
parent
4045e7b19b
commit
b42f02da2b
@@ -1691,7 +1691,7 @@ static int expect_vfprintf(int llen, int c, const char *expected, const char *fm
|
||||
}
|
||||
|
||||
llen += printf(" \"%s\" = \"%s\"", expected, buf);
|
||||
ret = strncmp(expected, buf, c);
|
||||
ret = strncmp(expected, buf, c) != 0;
|
||||
|
||||
result(llen, ret ? FAIL : OK);
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user