Forráskód Böngészése

libcompat: Use '\0' instead of NULL to terminate a string in vsnprintf

Guillem Jover 18 éve
szülő
commit
8b41182d2c
2 módosított fájl, 6 hozzáadás és 1 törlés
  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): Use '\0' instead of NULL to
+	terminate the string.
+
 2008-09-14  Guillem Jover  <guillem@debian.org>
 
 	* libcompat/compat.h (unsetenv): Change return type from void to int.

+ 1 - 1
libcompat/vsnprintf.c

@@ -70,7 +70,7 @@ vsnprintf(char *buf, size_t maxsize, const char *fmt, va_list al)
 	nr = fread(buf, 1, want - 1, file);
 	if (nr != want - 1)
 		return -1;
-	buf[want] = NULL;
+	buf[want] = '\0';
 
 	return retval;
 }