diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2016-08-10 00:43:39 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-08-10 00:43:39 +0000 |
commit | f5042cab109f7136191fd316be1471532d2ddf71 (patch) | |
tree | deca389ac5d2f7836714e247f08d0f49462f4f27 /libc/stdio/stdio.cpp | |
parent | ce11d26bd7486c28ee56fc5627bd87afd2747106 (diff) | |
parent | 53cf348c829cb36328755bbdbe46668ecbc55348 (diff) |
Merge "Remove more stdio copy/paste."
Diffstat (limited to 'libc/stdio/stdio.cpp')
-rw-r--r-- | libc/stdio/stdio.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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 <stdio.h> #include <errno.h> @@ -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<char*>(_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); } |