diff th_printf.c @ 547:c21051972015

Add int *prec and change int flags to int *flags in th_vprintf_altfmt_func function arguments.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 31 Dec 2019 05:22:15 +0200
parents edfe8ac12408
children 41efdd004c3a
line wrap: on
line diff
--- a/th_printf.c	Tue Dec 31 05:19:11 2019 +0200
+++ b/th_printf.c	Tue Dec 31 05:22:15 2019 +0200
@@ -118,6 +118,7 @@
 {
     (void) vret;
     (void) flags;
+    (void) prec;
 
     return (buf[len - 1] != '0') ? "0" : NULL;
 }
@@ -127,9 +128,10 @@
 {
     (void) buf;
     (void) len;
+    (void) prec;
 
     if (vret != 0)
-        return (flags & TH_PF_UPCASE) ? "0X" : "0x";
+        return (*flags & TH_PF_UPCASE) ? "0X" : "0x";
     else
         return NULL;
 }
@@ -161,7 +163,7 @@
 
     // Get alternative format string, if needed and available
     f_altstr = (f_flags & TH_PF_ALT) && f_alt != NULL ?
-        f_alt(buf, f_len, vret, f_flags) : NULL;
+        f_alt(buf, f_len, vret, &f_prec, &f_flags) : NULL;
 
     // Are we using a sign prefix?
     f_sign = f_unsig ? 0 : ((f_flags & TH_PF_SIGN) ?