summaryrefslogtreecommitdiffstats
path: root/include/vsprintf.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-01-14 13:02:03 -0500
committerTom Rini <trini@konsulko.com>2016-01-19 08:31:16 -0500
commit947c626dc5bfbc232cc0f41d16fa213a885ad234 (patch)
tree4d1f6443abd9dd3cb74ab5a8abb6f7e7a46d82cc /include/vsprintf.h
parent9c11135ce053904f4caadc27760f214425d9881a (diff)
downloadtalos-obmc-uboot-947c626dc5bfbc232cc0f41d16fa213a885ad234.tar.gz
talos-obmc-uboot-947c626dc5bfbc232cc0f41d16fa213a885ad234.zip
vsprintf.c: Always enable CONFIG_SYS_VSNPRINTF
Enabling this function always removes some class of string saftey issues. The size change here in general is about 400 bytes and this seems a reasonable trade-off. Cc: Peng Fan <peng.fan@nxp.com> Cc: Peter Robinson <pbrobinson@gmail.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Adrian Alonso <aalonso@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/vsprintf.h')
-rw-r--r--include/vsprintf.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/include/vsprintf.h b/include/vsprintf.h
index b5bc9c1d95..376f5dd324 100644
--- a/include/vsprintf.h
+++ b/include/vsprintf.h
@@ -124,7 +124,6 @@ int sprintf(char *buf, const char *fmt, ...)
int vsprintf(char *buf, const char *fmt, va_list args);
char *simple_itoa(ulong i);
-#ifdef CONFIG_SYS_VSNPRINTF
/**
* Format a string and place it in a buffer
*
@@ -199,17 +198,6 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
* See the vsprintf() documentation for format string extensions over C99.
*/
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
-#else
-/*
- * Use macros to silently drop the size parameter. Note that the 'cn'
- * versions are the same as the 'n' versions since the functions assume
- * there is always enough buffer space when !CONFIG_SYS_VSNPRINTF
- */
-#define snprintf(buf, size, fmt, args...) sprintf(buf, fmt, ##args)
-#define scnprintf(buf, size, fmt, args...) sprintf(buf, fmt, ##args)
-#define vsnprintf(buf, size, fmt, args...) vsprintf(buf, fmt, ##args)
-#define vscnprintf(buf, size, fmt, args...) vsprintf(buf, fmt, ##args)
-#endif /* CONFIG_SYS_VSNPRINTF */
/**
* print_grouped_ull() - print a value with digits grouped by ','
OpenPOWER on IntegriCloud