diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2014-11-28 17:35:44 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2014-11-28 17:35:44 +1100 |
commit | 566f139cffdcef5d1ce679cc1a7cfd0c7cde3f78 (patch) | |
tree | 22f3dd136757b03e8bf22831680d5e04d96e8c1a | |
parent | 124591c0f398341c0262ee2804c08c6f0e2dbdf6 (diff) | |
download | skiboot-566f139cffdcef5d1ce679cc1a7cfd0c7cde3f78.zip skiboot-566f139cffdcef5d1ce679cc1a7cfd0c7cde3f78.tar.gz skiboot-566f139cffdcef5d1ce679cc1a7cfd0c7cde3f78.tar.bz2 |
Remove vsprintf: just like sprintf, vsnprintf is a much better idea
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | ccan/list/test/run-check-corrupt.c | 2 | ||||
-rw-r--r-- | libc/include/stdio.h | 1 | ||||
-rw-r--r-- | libc/stdio/Makefile.inc | 2 | ||||
-rw-r--r-- | libc/stdio/vsprintf.c | 19 |
4 files changed, 2 insertions, 22 deletions
diff --git a/ccan/list/test/run-check-corrupt.c b/ccan/list/test/run-check-corrupt.c index 5dd9f9c..f4c20b5 100644 --- a/ccan/list/test/run-check-corrupt.c +++ b/ccan/list/test/run-check-corrupt.c @@ -17,7 +17,7 @@ static int my_fprintf(FILE *stream, const char *format, ...) va_list ap; int ret; va_start(ap, format); - ret = vsprintf(printf_buffer, format, ap); + ret = vsnprintf(printf_buffer, sizeof(printf_buffer), format, ap); va_end(ap); return ret; } diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 6dd82c3..787c06b 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -44,7 +44,6 @@ int printf(const char *format, ...) __attribute__((format (printf, 1, 2))); int fprintf(FILE *stream, const char *format, ...) __attribute__((format (printf, 2, 3))); int snprintf(char *str, size_t size, const char *format, ...) __attribute__((format (printf, 3, 4))); int vfprintf(FILE *stream, const char *format, va_list); -int vsprintf(char *str, const char *format, va_list); int vsnprintf(char *str, size_t size, const char *format, va_list); void setbuf(FILE *stream, char *buf); int setvbuf(FILE *stream, char *buf, int mode , size_t size); diff --git a/libc/stdio/Makefile.inc b/libc/stdio/Makefile.inc index 025ee01..7c3cb08 100644 --- a/libc/stdio/Makefile.inc +++ b/libc/stdio/Makefile.inc @@ -13,7 +13,7 @@ SUBDIRS += $(LIBCDIR)/stdio -STDIO_OBJS = fscanf.o vfprintf.o vsnprintf.o vsprintf.o fprintf.o \ +STDIO_OBJS = fscanf.o vfprintf.o vsnprintf.o fprintf.o \ setvbuf.o fputc.o puts.o fputs.o putchar.o scanf.o \ stdchnls.o vfscanf.o vsscanf.o fileno.o snprintf.o diff --git a/libc/stdio/vsprintf.c b/libc/stdio/vsprintf.c deleted file mode 100644 index 0dfd737..0000000 --- a/libc/stdio/vsprintf.c +++ /dev/null @@ -1,19 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2004, 2008 IBM Corporation - * All rights reserved. - * This program and the accompanying materials - * are made available under the terms of the BSD License - * which accompanies this distribution, and is available at - * http://www.opensource.org/licenses/bsd-license.php - * - * Contributors: - * IBM Corporation - initial implementation - *****************************************************************************/ - -#include "stdio.h" - -int -vsprintf(char *buffer, const char *format, va_list arg) -{ - return vsnprintf(buffer, 0x7fffffff, format, arg); -} |