Fix: static array larger than necessary
authorJérémie Galarneau <jeremie.galarneau@gmail.com>
Fri, 4 Jul 2014 19:28:42 +0000 (15:28 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 10 Jul 2014 14:52:32 +0000 (10:52 -0400)
The longest string that can be returned should be 20 chars long, as per
the comment.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/commands/list.c

index f69b3ba3d67b1b8ce5a2b02b839d032f306f4a0e..75288cd0a5867f0f005cc6c45913bfef71c69c71 100644 (file)
@@ -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");
This page took 0.028826 seconds and 4 git commands to generate.