wall: add fallback for failed sysconf()

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2014-07-17 15:19:34 +02:00
parent 86c58c4a82
commit 479912e7b3
1 changed files with 3 additions and 0 deletions

View File

@ -187,6 +187,9 @@ static char *makemsg(char *fname, char **mvec, int mvecsz,
long line_max;
line_max = sysconf(_SC_LINE_MAX);
if (line_max <= 0)
line_max = 512;
lbuf = xmalloc(line_max);
if ((fp = xfmkstemp(&tmpname, NULL)) == NULL)