From b7b84702476f6f46f5038feb115645402d8411c1 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 8 Feb 2019 13:44:31 +0100 Subject: [PATCH] mescc: Mes C Library: Support gcc-4.6.4: vfprintf, vsnprintf: pad with space. * lib/stdio/vfprintf.c (vfprintf): pad with space. * lib/stdio/vsnprintf.c (vsnprintf): pad with space. --- lib/stdio/vfprintf.c | 5 +++++ lib/stdio/vsnprintf.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lib/stdio/vfprintf.c b/lib/stdio/vfprintf.c index 624e6718..01190de8 100644 --- a/lib/stdio/vfprintf.c +++ b/lib/stdio/vfprintf.c @@ -48,6 +48,11 @@ vfprintf (FILE* f, char const* format, va_list ap) c = *++p; } char pad = ' '; + if (c == ' ') + { + pad = c; + c = *p++; + } if (c == '0') { pad = c; diff --git a/lib/stdio/vsnprintf.c b/lib/stdio/vsnprintf.c index a80d946e..8aeb766d 100644 --- a/lib/stdio/vsnprintf.c +++ b/lib/stdio/vsnprintf.c @@ -49,6 +49,11 @@ vsnprintf (char *str, size_t size, char const* format, va_list ap) c = *++p; } char pad = ' '; + if (c == ' ') + { + pad = c; + c = *p++; + } if (c == '0') { pad = c;