From 9eca6cc64392b4ad8bd8723e840f491fa36524ad Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 15 Nov 2010 21:15:26 +0100 Subject: slirp: Remove unused code for bad sprintf Neither DECLARE_SPRINTF nor BAD_SPRINTF are needed for QEMU. QEMU won't support systems with missing or bad declarations for sprintf. The unused code was detected while looking for functions with missing format checking. Instead of adding GCC_FMT_ATTR, the unused code was removed. Cc: Blue Swirl Signed-off-by: Stefan Weil Signed-off-by: Anthony Liguori --- slirp/misc.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'slirp/misc.c') diff --git a/slirp/misc.c b/slirp/misc.c index 1aeb401082..19dbec491f 100644 --- a/slirp/misc.c +++ b/slirp/misc.c @@ -264,48 +264,6 @@ void lprint(const char *format, ...) va_end(args); } -#ifdef BAD_SPRINTF - -#undef vsprintf -#undef sprintf - -/* - * Some BSD-derived systems have a sprintf which returns char * - */ - -int -vsprintf_len(string, format, args) - char *string; - const char *format; - va_list args; -{ - vsprintf(string, format, args); - return strlen(string); -} - -int -#ifdef __STDC__ -sprintf_len(char *string, const char *format, ...) -#else -sprintf_len(va_alist) va_dcl -#endif -{ - va_list args; -#ifdef __STDC__ - va_start(args, format); -#else - char *string; - char *format; - va_start(args); - string = va_arg(args, char *); - format = va_arg(args, char *); -#endif - vsprintf(string, format, args); - return strlen(string); -} - -#endif - void u_sleep(int usec) { -- cgit v1.2.3