summaryrefslogtreecommitdiffstats
path: root/src/printf-utils.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2013-04-07 14:39:45 +0200
committerPali Rohár <pali.rohar@gmail.com>2013-04-07 14:39:45 +0200
commita02caaac15b3fb3d848309229a0a1810427bb5ca (patch)
tree8cbbacbcdd674cb31f4e4bef403be19fedc2ae6f /src/printf-utils.c
parenta1febdd2ea6cd48d3c1eec54bbcd302a5efd0550 (diff)
download0xFFFF-a02caaac15b3fb3d848309229a0a1810427bb5ca.tar.bz2
printf-utils: Fix compile warning: declared with attribute warn_unused_result
Diffstat (limited to 'src/printf-utils.c')
-rw-r--r--src/printf-utils.c6
1 files changed, 3 insertions, 3 deletions
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;
}