diff options
-rw-r--r-- | extrace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/extrace.c b/extrace.c index e28a29c..38f92c7 100644 --- a/extrace.c +++ b/extrace.c @@ -366,8 +366,8 @@ handle_msg(struct cn_msg *cn_hdr) fprintf(output, "%d", pid); if (show_exit) { putc('+', output); - strncpy(pid_db[i].cmdline, cmdline, CMDLINE_DB_MAX-1); - pid_db[i].cmdline[CMDLINE_DB_MAX-1] = 0; + snprintf(pid_db[i].cmdline, CMDLINE_DB_MAX, + "%s", cmdline); } if (show_user) { struct stat st; |