The longest string that can be returned should be 20 chars long, as per
the comment.
Signed-off-by: David Goulet <dgoulet@efficios.com>
int ret;
FILE *fp;
char *cmdline = NULL;
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");
snprintf(path, sizeof(path), "/proc/%d/cmdline", pid);
fp = fopen(path, "r");