From 7a4a9b9b47d2fe9b90cee95d68d89faa24a118d4 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Tue, 14 Mar 2023 20:25:11 +0000 Subject: Fixed a bug in KLEE libc's implementation of strcmp: according to the C standard, characters should be compared as unsigned chars. --- runtime/klee-libc/strcmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/klee-libc/strcmp.c b/runtime/klee-libc/strcmp.c index cdb002c7..e95df928 100644 --- a/runtime/klee-libc/strcmp.c +++ b/runtime/klee-libc/strcmp.c @@ -10,5 +10,5 @@ int strcmp(const char *a, const char *b) { while (*a && *a == *b) ++a, ++b; - return *a - *b; + return *(const unsigned char*)a - *(const unsigned char*)b; } -- cgit 1.4.1