about summary refs log tree commit diff homepage
path: root/runtime
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2023-03-14 20:25:11 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-03-16 15:54:38 +0000
commit7a4a9b9b47d2fe9b90cee95d68d89faa24a118d4 (patch)
tree42425ff763f928e06c6fbaf6f8910c89eae38ac9 /runtime
parent7e49c161b76c687f5813e81305ca6697a397478a (diff)
downloadklee-7a4a9b9b47d2fe9b90cee95d68d89faa24a118d4.tar.gz
Fixed a bug in KLEE libc's implementation of strcmp: according to the C standard, characters should be compared as unsigned chars.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/klee-libc/strcmp.c2
1 files changed, 1 insertions, 1 deletions
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;
 }