ia64/xen-unstable

changeset 16671:19f549449cb5

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 <samuel.thibault@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Dec 28 15:23:28 2007 +0000 (2007-12-28)
parents 4624795a2346
children c0a9b8ab631c
files extras/mini-os/lib/printf.c xen/common/vsprintf.c
line diff
     1.1 --- a/extras/mini-os/lib/printf.c	Thu Dec 27 23:01:50 2007 +0000
     1.2 +++ b/extras/mini-os/lib/printf.c	Fri Dec 28 15:23:28 2007 +0000
     1.3 @@ -426,8 +426,6 @@ int vsnprintf(char *buf, size_t size, co
     1.4  
     1.5  
     1.6          case 'n':
     1.7 -            /* FIXME:
     1.8 -             * What does C99 say about the overflow case here? */
     1.9              if (qualifier == 'l') {
    1.10                  long * ip = va_arg(args, long *);
    1.11                  *ip = (str - buf);
    1.12 @@ -446,7 +444,7 @@ int vsnprintf(char *buf, size_t size, co
    1.13              ++str;
    1.14              continue;
    1.15  
    1.16 -                        /* integer number formats - set up the flags and "break" */
    1.17 +            /* integer number formats - set up the flags and "break" */
    1.18          case 'o':
    1.19              base = 8;
    1.20              break;
     2.1 --- a/xen/common/vsprintf.c	Thu Dec 27 23:01:50 2007 +0000
     2.2 +++ b/xen/common/vsprintf.c	Fri Dec 28 15:23:28 2007 +0000
     2.3 @@ -404,8 +404,6 @@ int vsnprintf(char *buf, size_t size, co
     2.4  
     2.5  
     2.6          case 'n':
     2.7 -            /* FIXME:
     2.8 -             * What does C99 say about the overflow case here? */
     2.9              if (qualifier == 'l') {
    2.10                  long * ip = va_arg(args, long *);
    2.11                  *ip = (str - buf);
    2.12 @@ -424,7 +422,7 @@ int vsnprintf(char *buf, size_t size, co
    2.13              ++str;
    2.14              continue;
    2.15  
    2.16 -                        /* integer number formats - set up the flags and "break" */
    2.17 +            /* integer number formats - set up the flags and "break" */
    2.18          case 'o':
    2.19              base = 8;
    2.20              break;