From 5db500ac4edd51f3933d8eddb235bd4bd2895cf0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 1 Feb 2010 03:02:18 -0500 Subject: [PATCH] Fixed compiler warning on newer Linux systems. (transplanted from 3ab4702d6313b2590f202f1475cd68976765f02f) --- test/test_physfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_physfs.c b/test/test_physfs.c index e23cb4d..74403c6 100644 --- a/test/test_physfs.c +++ b/test/test_physfs.c @@ -1066,7 +1066,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);