X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/f0fca04e4e136c4a487a922e8fb09acf46aeafa0..344fb1276b0215f7b3fb5067fae69619691541c8:/io.c diff --git a/io.c b/io.c index 587b3c74..52c4cb14 100644 --- a/io.c +++ b/io.c @@ -148,7 +148,8 @@ static int readfd(int fd,char *buffer,int N) tv.tv_sec = io_timeout; tv.tv_usec = 0; - if (select(fd+1, &fds, NULL, NULL, &tv) != 1) { + if (select(fd+1, &fds, NULL, NULL, + io_timeout?&tv:NULL) != 1) { check_timeout(); } } @@ -472,7 +473,8 @@ void io_printf(int fd, const char *format, ...) #if HAVE_VSNPRINTF len = vsnprintf(buf, sizeof(buf)-1, format, ap); #else - len = vsprintf(buf, format, ap); + vsprintf(buf, format, ap); + len = strlen(buf); #endif va_end(ap);