X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fvsprintf.c;h=bed7229378f2da073be0c25eda0a30bf07146380;hb=2fd8507d14ef7af3ae05316b3277044cf6daa381;hp=797428afd1114f3dc1ad3c239917b9f04ceccd55;hpb=e905914f96e11862b130dd229f73045dad9a34e8;p=linux-2.6 diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 797428afd1..bed7229378 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -489,7 +489,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) if (str < end) *str = '\0'; else - *end = '\0'; + end[-1] = '\0'; } /* the trailing null byte doesn't count towards the total */ return str-buf;