From 0d7e8edd7cd139ca5ceab70665d4b60deb620389 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sun, 7 Feb 2016 11:23:59 -0500 Subject: [PATCH] Warning suppression. --- demos/tuidemo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demos/tuidemo.c b/demos/tuidemo.c index cb2ffcc7..e3e49c27 100644 --- a/demos/tuidemo.c +++ b/demos/tuidemo.c @@ -74,7 +74,7 @@ void showfile(char *fname) { int i, bh = bodylen(); FILE *fp; - char buf[MAXSTRLEN]; + char buf[MAXSTRLEN], *result; bool ateof = FALSE; statusmsg("FileBrowser: Hit key to continue, Q to quit"); @@ -88,9 +88,9 @@ void showfile(char *fname) for (i = 0; i < bh - 1 && !ateof; i++) { buf[0] = '\0'; - fgets(buf, MAXSTRLEN, fp); + result = fgets(buf, MAXSTRLEN, fp); - if (strlen(buf)) + if (result && strlen(buf)) bodymsg(buf); else ateof = TRUE;