From: Jérémie Galarneau Date: Fri, 4 Jul 2014 19:28:42 +0000 (-0400) Subject: Fix: static array larger than necessary X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=5f1abdd942402eca8534903be9f6c1cddaa09185 Fix: static array larger than necessary The longest string that can be returned should be 20 chars long, as per the comment. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 8c1d5af87..87935393e 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -107,7 +107,7 @@ static char *get_cmdline_by_pid(pid_t pid) int ret; FILE *fp; char *cmdline = NULL; - char path[24]; /* Can't go bigger than /proc/65535/cmdline */ + char path[20]; /* Can't go bigger than /proc/65535/cmdline */ snprintf(path, sizeof(path), "/proc/%d/cmdline", pid); fp = fopen(path, "r");