printf("%n" behavior on overflow
PATCH 1/1 printf("%n" behavior on overflow
Hello,
In C99 (7.19.6.2.10), the behavior of scanf("stuff... %n", ..., &n) is said to be undefined if the value to be put is n can't fit. I guess we can safely consider that the same applies to printf.
Signed-off-by Samuel Thibault <[email protected]>
extras/mini-os/lib/printf.c +0 -2
@@ -426,8 +426,6 @@ int vsnprintf(char *buf, size_t size, cocase 'n' : -/* FIXME: -* What does C99 say about the overflow case here? */ if (qualifier =='l' ) { long * ip = va_arg(args, long *); *ip = (str - buf);