mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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>
This commit is contained in:
1 parent
f53513b012
commit
8f8a3b5659
2 files changed
+2
-6
No files matched your search
@@ -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;
|
||||
|
||||
@@ -404,8 +404,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);
|
||||
@@ -424,7 +422,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;
|
||||
|
||||