From: Keir Fraser Date: Tue, 30 Jan 2007 16:27:53 +0000 (+0000) Subject: Remove sprintf() from Xen. Use snprintf() and friends. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15368^2~13 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=57464e1a9c3cb428be95284e6721a04e9a07024e;p=xen.git Remove sprintf() from Xen. Use snprintf() and friends. Signed-off-by: Keir Fraser --- diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c index f4b788c403..355305fa57 100644 --- a/xen/common/vsprintf.c +++ b/xen/common/vsprintf.c @@ -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 diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h index 5eca2b08c6..78c57faf06 100644 --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -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)));