Add snprintf and remove our sprintf
This commit is contained in:
parent
5b6b2f98b7
commit
df9f3030e6
|
@ -22,7 +22,7 @@ endif
|
||||||
# makefile at its root level - these are then overridden
|
# makefile at its root level - these are then overridden
|
||||||
# for a subtree within the makefile rooted therein
|
# for a subtree within the makefile rooted therein
|
||||||
#
|
#
|
||||||
#DEFINES +=
|
DEFINES += -DHAVE_CONFIG_H
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
# Recursion Magic - Don't touch this!!
|
# Recursion Magic - Don't touch this!!
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
#ifndef SNP_CONFIG_H
|
||||||
|
#define SNP_CONFIG_H
|
||||||
|
|
||||||
|
#define TEST_SNPRINTF 0
|
||||||
|
#define HAVE_SNPRINTF 0
|
||||||
|
#define HAVE_VSNPRINTF 0
|
||||||
|
#define HAVE_ASPRINTF 0
|
||||||
|
#define HAVE_VASPRINTF 0
|
||||||
|
|
||||||
|
#define HAVE_STDARG_H 1
|
||||||
|
#define HAVE_STDLIB_H 1
|
||||||
|
|
||||||
|
#define HAVE_VA_COPY 0
|
||||||
|
#define HAVE___VA_COPY 0
|
||||||
|
#define HAVE_FLOAT_H 1
|
||||||
|
#define HAVE_INTTYPES_H 1
|
||||||
|
#define HAVE_LOCALE_H 0
|
||||||
|
#define HAVE_STDDEF_H 1
|
||||||
|
#define HAVE_STDINT_H 1
|
||||||
|
#define HAVE_UNSIGNED_LONG_LONG_INT 1
|
||||||
|
#define HAVE_UINTMAX_T 1
|
||||||
|
#define HAVE_LONG_DOUBLE 0
|
||||||
|
#define HAVE_LONG_LONG_INT 1
|
||||||
|
#define HAVE_INTMAX_T 1
|
||||||
|
#define HAVE_UINTPTR_T 1
|
||||||
|
#define HAVE_PTRDIFF_T 1
|
||||||
|
|
||||||
|
#define HAVE_LOCALECONV 0
|
||||||
|
#define HAVE_LCONV_DECIMAL_POINT 0
|
||||||
|
#define HAVE_LCONV_THOUSANDS_SEP 0
|
||||||
|
#define LDOUBLE_MIN_10_EXP DBL_MIN_10_EXP
|
||||||
|
#define LDOUBLE_MAX_10_EXP DBL_MAX_10_EXP
|
||||||
|
|
||||||
|
#define rpl_snprintf snprintf
|
||||||
|
#define rpl_vsnprintf vsnprintf
|
||||||
|
#define rpl_vasprintf vasprintf
|
||||||
|
#define rpl_asprintf asprintf
|
||||||
|
|
||||||
|
#endif /* SNP_CONFIG_H */
|
File diff suppressed because it is too large
Load Diff
1072
app/libc/stdio.c
1072
app/libc/stdio.c
File diff suppressed because it is too large
Load Diff
|
@ -14,8 +14,9 @@ extern void output_redirect(const char *str, size_t l);
|
||||||
|
|
||||||
#define printf(...) do { \
|
#define printf(...) do { \
|
||||||
char __printf_buf[BUFSIZ]; \
|
char __printf_buf[BUFSIZ]; \
|
||||||
sprintf(__printf_buf, __VA_ARGS__); \
|
snprintf(__printf_buf, BUFSIZ, __VA_ARGS__); \
|
||||||
puts(__printf_buf); \
|
puts(__printf_buf); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue