Home
tests/cc: Fix loop condition in execute/0169-string.c cmp() function - scc - simple c99 compiler HTML git clone git://git.simple-cc.org/scc DIR Log DIR Files DIR Refs DIR Submodules DIR README DIR LICENSE --- DIR commit 1d8969baa52c6ee8981869fd67c8c22cd0707fad DIR parent da15e0d9945be83baead323b081ec436d5852b57 HTML Author: Michael Forney <mforney@mforney.org> Date: Mon, 25 Mar 2024 23:32:30 -0700 tests/cc: Fix loop condition in execute/0169-string.c cmp() function We want to check that the strings are the same, not that every character is different. Diffstat: M tests/cc/execute/0169-string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- DIR diff --git a/tests/cc/execute/0169-string.c b/tests/cc/execute/0169-string.c @@ -7,7 +7,7 @@ char *p = "foo"; int cmp(char *s1, char *s2) { - while (*s1 && *s1++ != *s2++) + while (*s1 && *s1++ == *s2++) ; return *s1; }