From a02caaac15b3fb3d848309229a0a1810427bb5ca Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sun, 7 Apr 2013 14:39:45 +0200 Subject: printf-utils: Fix compile warning: declared with attribute warn_unused_result --- src/printf-utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/printf-utils.c') diff --git a/src/printf-utils.c b/src/printf-utils.c index 9e2f99d..2056f85 100644 --- a/src/printf-utils.c +++ b/src/printf-utils.c @@ -77,7 +77,8 @@ void printf_and_wait(const char * format, ...) { FD_SET(0, &rfds); while ( select(1, &rfds, NULL, NULL, &tv) == 1 ) - read(0, &c, 1); + if ( read(0, &c, 1) < 0 ) + break; va_start(ap, format); vprintf(format, ap); @@ -88,8 +89,7 @@ void printf_and_wait(const char * format, ...) { FD_SET(0, &rfds); while ( select(1, &rfds, NULL, NULL, NULL) == 1 ) { - read(0, &c, 1); - if ( c == '\n' ) + if ( read(0, &c, 1) < 0 || c == '\n' ) break; } -- cgit v1.2.3