WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Remove sprintf() from Xen. Use snprintf() and friends.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 Jan 2007 07:05:29 -0800
Delivery-date: Wed, 31 Jan 2007 07:51:03 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Remove sprintf() from Xen. Use snprintf() and friends., Xen patchbot-unstable <=