Selaa lähdekoodia

libcompat: Check that vfprintf returns negative and not only EOF

Guillem Jover 18 vuotta sitten
vanhempi
commit
1f230d812e
2 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 5 0
      ChangeLog
  2. 1 1
      libcompat/vsnprintf.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-09-14  Guillem Jover  <guillem@debian.org>
+
+	* libcompat/vsnprintf.c (vsnprintf): Check for negative return error
+	values instead of just EOF.
+
 2008-09-14  Guillem Jover  <guillem@debian.org>
 
 	* libcompat/snprintf.c (snprintf): Use vsnprintf instead of vsprintf.

+ 1 - 1
libcompat/vsnprintf.c

@@ -50,7 +50,7 @@ vsnprintf(char *buf, size_t maxsize, const char *fmt, va_list al)
 			return -1;
 	}
 
-	if (vfprintf(file, fmt, al) == EOF)
+	if (vfprintf(file, fmt, al) < 0)
 		return -1;
 	if (fflush(file))
 		return -1;