changeset 357:77201824790c

Use th_printf_vput_repch() where appropriate.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 25 Feb 2016 09:49:53 +0200
parents d7f43fce0dce
children a224327ad94e
files th_string.c
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/th_string.c	Thu Feb 25 09:49:28 2016 +0200
+++ b/th_string.c	Thu Feb 25 09:49:53 2016 +0200
@@ -216,12 +216,8 @@
     if (f_sign && (f_flags & TH_PF_ZERO) == 0 && (ret = vputch(ctx, f_sign)) == EOF)
         return ret;
 
-    while (f_prec-- > 0)
-    {
-        int ret;
-        if ((ret = vputch(ctx, '0')) == EOF)
-            return ret;
-    }
+    if ((ret = th_printf_vput_repch(ctx, vputch, f_prec, '0')) == EOF)
+        return ret;
 
     // Output the value
     while (f_len-- > 0)