direct-io.hg

changeset 13730:d96b346cab5d

Remove sprintf() from Xen. Use snprintf() and friends.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Tue Jan 30 16:27:53 2007 +0000 (2007-01-30)
parents 37fd1cf9019d
children 3b0b70a4fd62
files xen/common/vsprintf.c xen/include/xen/lib.h
line diff
     1.1 --- a/xen/common/vsprintf.c	Tue Jan 30 16:23:35 2007 +0000
     1.2 +++ b/xen/common/vsprintf.c	Tue Jan 30 16:27:53 2007 +0000
     1.3 @@ -561,29 +561,6 @@ int scnprintf(char * buf, size_t size, c
     1.4  }
     1.5  EXPORT_SYMBOL(scnprintf);
     1.6  
     1.7 -/**
     1.8 - * sprintf - Format a string and place it in a buffer
     1.9 - * @buf: The buffer to place the result into
    1.10 - * @fmt: The format string to use
    1.11 - * @...: Arguments for the format string
    1.12 - *
    1.13 - * The function returns the number of characters written
    1.14 - * into @buf. Use snprintf or scnprintf in order to avoid
    1.15 - * buffer overflows.
    1.16 - */
    1.17 -int sprintf(char * buf, const char *fmt, ...)
    1.18 -{
    1.19 -    va_list args;
    1.20 -    int i;
    1.21 -
    1.22 -    va_start(args, fmt);
    1.23 -    i=vsnprintf(buf, INT_MAX, fmt, args);
    1.24 -    va_end(args);
    1.25 -    return i;
    1.26 -}
    1.27 -
    1.28 -EXPORT_SYMBOL(sprintf);
    1.29 -
    1.30  /*
    1.31   * Local variables:
    1.32   * mode: C
     2.1 --- a/xen/include/xen/lib.h	Tue Jan 30 16:23:35 2007 +0000
     2.2 +++ b/xen/include/xen/lib.h	Tue Jan 30 16:27:53 2007 +0000
     2.3 @@ -60,8 +60,7 @@ extern int __printk_ratelimit(int rateli
     2.4  extern int printk_ratelimit(void);
     2.5  
     2.6  /* vsprintf.c */
     2.7 -extern int sprintf(char * buf, const char * fmt, ...)
     2.8 -    __attribute__ ((format (printf, 2, 3)));
     2.9 +#define sprintf __xen_has_no_sprintf__
    2.10  #define vsprintf __xen_has_no_vsprintf__
    2.11  extern int snprintf(char * buf, size_t size, const char * fmt, ...)
    2.12      __attribute__ ((format (printf, 3, 4)));