diff options
author | Martin Nowack <martin.nowack@gmail.com> | 2013-08-27 22:16:42 +0200 |
---|---|---|
committer | Martin Nowack <martin.nowack@gmail.com> | 2013-08-27 23:22:28 +0200 |
commit | a9bad13dd6000b431c8ef917515c1f33e2d67a05 (patch) | |
tree | 2acbd2d0c754aa94803d989842598b18c903d145 | |
parent | c4147c2ad9ba1e74642e1a3de31be8f4446cc7f3 (diff) | |
download | klee-a9bad13dd6000b431c8ef917515c1f33e2d67a05.tar.gz |
Fix implementation for putchar
According to manual: putchar() return the character written as an unsigned char cast to an int or EOF on error. Use return value of write to return the correct value for putchar.
-rw-r--r-- | runtime/klee-libc/putchar.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/klee-libc/putchar.c b/runtime/klee-libc/putchar.c index 4c3a57e4..497402a6 100644 --- a/runtime/klee-libc/putchar.c +++ b/runtime/klee-libc/putchar.c @@ -15,6 +15,7 @@ int putchar(int c) { char x = c; - write(1, &x, 1); - return 1; + if (1 == write(1, &x, 1)) + return c; + return EOF; } |