aboutsummaryrefslogtreecommitdiffstats
path: root/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/printf.c b/printf.c
index 56f60d6..f1a51e2 100644
--- a/printf.c
+++ b/printf.c
@@ -647,7 +647,8 @@ int printf(const char* format, ...)
{
va_list va;
va_start(va, format);
- const int ret = _vsnprintf(_out_char, NULL, (size_t)-1, format, va);
+ char buffer[1];
+ const int ret = _vsnprintf(_out_char, buffer, (size_t)-1, format, va);
va_end(va);
return ret;
}