]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
In C99 (7.19.6.2.10), the behavior of scanf("stuff... %n", ..., &n) is
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 28 Dec 2007 15:23:28 +0000 (15:23 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 28 Dec 2007 15:23:28 +0000 (15:23 +0000)
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 <samuel.thibault@citrix.com>
lib/printf.c

index 676f4e74a1bf66ebc2b4aa43dac4fef71b6218bd..a6767e48adcb96fc13d16d81fb9b89054d361fe3 100644 (file)
@@ -426,8 +426,6 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
 
 
         case 'n':
-            /* FIXME:
-             * What does C99 say about the overflow case here? */
             if (qualifier == 'l') {
                 long * ip = va_arg(args, long *);
                 *ip = (str - buf);
@@ -446,7 +444,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
             ++str;
             continue;
 
-                        /* integer number formats - set up the flags and "break" */
+            /* integer number formats - set up the flags and "break" */
         case 'o':
             base = 8;
             break;