WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.1-testing] In C99 (7.19.6.2.10), the behavior of

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] In C99 (7.19.6.2.10), the behavior of scanf("stuff... %n", ..., &n) is
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 10 Jan 2008 06:30:25 -0800
Delivery-date: Thu, 10 Jan 2008 06:32:23 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1198856830 0
# Node ID 51cbb2440b565475e6e8b0c2a004022b350b566d
# Parent  690a80169633678512629bf68da972bc7f389ec5
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@xxxxxxxxxx>
xen-unstable changeset:   16671:19f549449cb5
xen-unstable date:        Fri Dec 28 15:23:28 2007 +0000
---
 extras/mini-os/lib/printf.c |    4 +---
 xen/common/vsprintf.c       |    4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff -r 690a80169633 -r 51cbb2440b56 extras/mini-os/lib/printf.c
--- a/extras/mini-os/lib/printf.c       Thu Dec 27 22:57:41 2007 +0000
+++ b/extras/mini-os/lib/printf.c       Fri Dec 28 15:47:10 2007 +0000
@@ -426,8 +426,6 @@ int vsnprintf(char *buf, size_t size, co
 
 
         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, co
             ++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;
diff -r 690a80169633 -r 51cbb2440b56 xen/common/vsprintf.c
--- a/xen/common/vsprintf.c     Thu Dec 27 22:57:41 2007 +0000
+++ b/xen/common/vsprintf.c     Fri Dec 28 15:47:10 2007 +0000
@@ -404,8 +404,6 @@ int vsnprintf(char *buf, size_t size, co
 
 
         case 'n':
-            /* FIXME:
-             * What does C99 say about the overflow case here? */
             if (qualifier == 'l') {
                 long * ip = va_arg(args, long *);
                 *ip = (str - buf);
@@ -424,7 +422,7 @@ int vsnprintf(char *buf, size_t size, co
             ++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;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.1-testing] In C99 (7.19.6.2.10), the behavior of scanf("stuff... %n", ..., &n) is, Xen patchbot-3.1-testing <=