Remove sprintf() from Xen. Use snprintf() and friends.
authorKeir Fraser <keir@xensource.com>
Tue, 30 Jan 2007 16:27:53 +0000 (16:27 +0000)
committerKeir Fraser <keir@xensource.com>
Tue, 30 Jan 2007 16:27:53 +0000 (16:27 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/common/vsprintf.c
xen/include/xen/lib.h

index f4b788c403348dcc1e02f1e54ed7864879f5e8a0..355305fa5738e0ec8322819e2cb13e20353a825f 100644 (file)
@@ -561,29 +561,6 @@ int scnprintf(char * buf, size_t size, const char *fmt, ...)
 }
 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
index 5eca2b08c60d0a44594d5f9375561778a58bf014..78c57faf0692b2ec68b35d4f8c15d91337d85192 100644 (file)
@@ -60,8 +60,7 @@ extern int __printk_ratelimit(int ratelimit_ms, int ratelimit_burst);
 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)));