Fixed compiler warning on newer Linux systems.

(transplanted from 3ab4702d6313b2590f202f1475cd68976765f02f)
This commit is contained in:
Ryan C. Gordon 2010-02-01 03:02:18 -05:00
parent 0310835418
commit 7aaa4dc6bf
1 changed files with 3 additions and 1 deletions

View File

@ -1116,7 +1116,9 @@ static void open_history_file(void)
do
{
fgets(buf, sizeof (buf), f);
if (fgets(buf, sizeof (buf), f) == NULL)
break;
if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf) - 1] = '\0';
add_history(buf);