X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=lib%2Fvsprintf.c;h=bed7229378f2da073be0c25eda0a30bf07146380;hb=a68aa1cc6f3203b8a332683ebde67a00f39eec43;hp=797428afd1114f3dc1ad3c239917b9f04ceccd55;hpb=61b9175808670d9abf52156803ae0ed1e3706ac4;p=mv-sheeva.git diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 797428afd11..bed7229378f 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;