diff options
author | Cristian Cadar <c.cadar@imperial.ac.uk> | 2019-08-13 20:28:51 +0100 |
---|---|---|
committer | MartinNowack <martin.nowack@gmail.com> | 2019-08-14 16:26:48 +0100 |
commit | dc414fde33f3ec22a6ae3cf29cfc6bc4a9ddae1a (patch) | |
tree | 56c1467c47fd45bdc2e3bad46b9b82b4186d4b8f /tools/klee-replay/klee-replay.c | |
parent | 8426b2913e650970d46be9a4d088bf3945f41453 (diff) | |
download | klee-dc414fde33f3ec22a6ae3cf29cfc6bc4a9ddae1a.tar.gz |
Replace sprintf with snprintf throughout codebase
Diffstat (limited to 'tools/klee-replay/klee-replay.c')
-rw-r--r-- | tools/klee-replay/klee-replay.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/klee-replay/klee-replay.c b/tools/klee-replay/klee-replay.c index f285ebf9..456c477d 100644 --- a/tools/klee-replay/klee-replay.c +++ b/tools/klee-replay/klee-replay.c @@ -69,7 +69,7 @@ static void stop_monitored(int process) { 0 }; char pids[64]; - sprintf(pids, "%d", process); + snprintf(pids, sizeof(pids), "%d", process); gdbargs[2] = pids; /* Make sure gdb doesn't talk to the user */ @@ -111,6 +111,7 @@ static void int_handler(int signal) { _exit(99); } } + static void timeout_handler(int signal) { fprintf(stderr, "KLEE-REPLAY: NOTE: EXIT STATUS: TIMED OUT (%d seconds)\n", monitored_timeout); @@ -139,7 +140,7 @@ void process_status(int status, time_t elapsed, const char *pfx) { if (rc == 0) { strcpy(msg, "NORMAL"); } else { - sprintf(msg, "ABNORMAL %d", rc); + snprintf(msg, sizeof(msg), "ABNORMAL %d", rc); } fprintf(stderr, "KLEE-REPLAY: NOTE: EXIT STATUS: %s (%d seconds)\n", msg, (int) elapsed); _exit(rc); @@ -406,7 +407,7 @@ int main(int argc, char** argv) { } -/* Klee functions */ +/* KLEE functions */ int __fputc_unlocked(int c, FILE *f) { return fputc_unlocked(c, f); |