+2008-12-05 Eli Zaretskii <eliz@gnu.org>
+
+ * process.c (procfs_system_process_attributes): If `nread' has a
+ negative value, assign zero to it.
+
2008-12-05 Chong Yidong <cyd@stupidchicken.com>
* eval.c (Vdebug_on_error): Doc fix.
cmdline[0] = '\0';
if ((nread = read (fd, cmdline, cmdline_size)) >= 0)
cmdline[nread++] = '\0';
+ else
+ {
+ /* Assigning zero to `nread' makes us skip the following
+ two loops, assign zero to cmdline_size, and enter the
+ following `if' clause that handles unknown command
+ lines. */
+ nread = 0;
+ }
/* We don't want trailing null characters. */
for (p = cmdline + nread - 1; p > cmdline && !*p; p--)
nread--;
}
cmdline_size = nread;
}
- else
+ if (!cmdline_size)
{
if (!cmd)
cmd = "???";