mescc: Mes C Library: Support gcc-4.6.4: vfprintf, vsnprintf: pad with space.
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 20 Sep 2019 12:44:31 +0000 (14:44 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 20 Sep 2019 12:44:31 +0000 (14:44 +0200)
* lib/stdio/vfprintf.c (vfprintf): pad with space.
* lib/stdio/vsnprintf.c (vsnprintf): pad with space.

lib/stdio/vfprintf.c
lib/stdio/vsnprintf.c

index 00ac49173f81ccefca448bc19af29818e7740119..0b2c30a01f5045b230bb81a1d2f405e4ab08a71e 100644 (file)
@@ -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;
index b1ed2e0a658c981a9a5ba4923b22e06d0ac1db06..9a8d796d202a9fe2a5d71dfa475b9e028c8caa8e 100644 (file)
@@ -50,6 +50,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;