[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Remove sprintf() from Xen. Use snprintf() and friends.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1170174473 0
# Node ID d96b346cab5d5475e9702e99232a538fa2acc231
# Parent  37fd1cf9019da835e066791230a6968186343cb2
Remove sprintf() from Xen. Use snprintf() and friends.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/common/vsprintf.c |   23 -----------------------
 xen/include/xen/lib.h |    3 +--
 2 files changed, 1 insertion(+), 25 deletions(-)

diff -r 37fd1cf9019d -r d96b346cab5d xen/common/vsprintf.c
--- a/xen/common/vsprintf.c     Tue Jan 30 16:23:35 2007 +0000
+++ b/xen/common/vsprintf.c     Tue Jan 30 16:27:53 2007 +0000
@@ -561,29 +561,6 @@ int scnprintf(char * buf, size_t size, c
 }
 EXPORT_SYMBOL(scnprintf);
 
-/**
- * sprintf - Format a string and place it in a buffer
- * @buf: The buffer to place the result into
- * @fmt: The format string to use
- * @...: Arguments for the format string
- *
- * The function returns the number of characters written
- * into @buf. Use snprintf or scnprintf in order to avoid
- * buffer overflows.
- */
-int sprintf(char * buf, const char *fmt, ...)
-{
-    va_list args;
-    int i;
-
-    va_start(args, fmt);
-    i=vsnprintf(buf, INT_MAX, fmt, args);
-    va_end(args);
-    return i;
-}
-
-EXPORT_SYMBOL(sprintf);
-
 /*
  * Local variables:
  * mode: C
diff -r 37fd1cf9019d -r d96b346cab5d xen/include/xen/lib.h
--- a/xen/include/xen/lib.h     Tue Jan 30 16:23:35 2007 +0000
+++ b/xen/include/xen/lib.h     Tue Jan 30 16:27:53 2007 +0000
@@ -60,8 +60,7 @@ extern int printk_ratelimit(void);
 extern int printk_ratelimit(void);
 
 /* vsprintf.c */
-extern int sprintf(char * buf, const char * fmt, ...)
-    __attribute__ ((format (printf, 2, 3)));
+#define sprintf __xen_has_no_sprintf__
 #define vsprintf __xen_has_no_vsprintf__
 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
     __attribute__ ((format (printf, 3, 4)));

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.