From 53cf348c829cb36328755bbdbe46668ecbc55348 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 9 Aug 2016 13:06:41 -0700 Subject: Remove more stdio copy/paste. Change-Id: Ia92629b75d2c153ecf1cec711e2f9575eef604ab --- libc/stdio/stdio.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libc/stdio/stdio.cpp') diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp index 23a54de35..c6736118e 100644 --- a/libc/stdio/stdio.cpp +++ b/libc/stdio/stdio.cpp @@ -31,6 +31,7 @@ * SUCH DAMAGE. */ +#define __BIONIC_NO_STDIO_FORTIFY #include #include @@ -643,6 +644,10 @@ FILE* funopen64(const void* cookie, return fp; } +int asprintf(char** s, const char* fmt, ...) { + PRINTF_IMPL(vasprintf(s, fmt, ap)); +} + char* ctermid(char* s) { return s ? strcpy(s, _PATH_TTY) : const_cast(_PATH_TTY); } @@ -769,6 +774,18 @@ int setlinebuf(FILE* fp) { return setvbuf(fp, nullptr, _IOLBF, 0); } +int snprintf(char* s, size_t n, const char* fmt, ...) { + PRINTF_IMPL(vsnprintf(s, n, fmt, ap)); +} + +int sprintf(char* s, const char* fmt, ...) { + PRINTF_IMPL(vsnprintf(s, INT_MAX, fmt, ap)); +} + +int sscanf(const char* s, const char* fmt, ...) { + PRINTF_IMPL(vsscanf(s, fmt, ap)); +} + int swprintf(wchar_t* s, size_t n, const wchar_t* fmt, ...) { PRINTF_IMPL(vswprintf(s, n, fmt, ap)); } @@ -785,6 +802,10 @@ int vscanf(const char* fmt, va_list ap) { return vfscanf(stdin, fmt, ap); } +int vsprintf(char* s, const char* fmt, va_list ap) { + return vsnprintf(s, INT_MAX, fmt, ap); +} + int vwprintf(const wchar_t* fmt, va_list ap) { return vfwprintf(stdout, fmt, ap); } -- cgit v1.2.3