A pointer to `char buf[...]' is taken, the array being declared in a
block scope inside the function. The pointer is passed to strdup(3) as
the function returned, but the array is by then out of scope. Move the
array to the function's scope. Fixes
0c50c669.
get_file_info(const char *proc, const char *file_name) {
char *cmd, *cp;
char *quotec = "'";
+ char buf[max(BUFSIZ, 2048)];
if ((cp = strchr(file_name, '\''))) {
/* file_name contains a single quote. */
FILE *fp;
if ((fp = popen(cmd, "r")) != NULL) {
- char buf[max(BUFSIZ, 2048)];
buf[0] = '\0';
if (fgets(buf, sizeof buf, fp)) {