changeset 536:173609d71821

Cosmetics.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 30 Dec 2019 12:27:32 +0200
parents ab23d3b3e749
children 7fd1c51f3b18
files th_printf.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/th_printf.c	Mon Dec 30 12:26:11 2019 +0200
+++ b/th_printf.c	Mon Dec 30 12:27:32 2019 +0200
@@ -126,8 +126,8 @@
 char * th_vprintf_altfmt_hex(const char *buf, const size_t len, const int vret, const int flags)
 {
     (void) buf;
-    (void) vret;
     (void) len;
+
     if (vret != 0)
         return (flags & TH_PF_UPCASE) ? "0X" : "0x";
     else
@@ -176,8 +176,7 @@
     // << XXX TODO FIXME: The logic here is not very elegant, and it's incorrect
     // at least for some alternate format modifier cases.
     //
-
-    int nlen =  (f_sign ? 1 : 0) + (f_altstr ? strlen(f_altstr) : 0);
+    int nlen = (f_sign ? 1 : 0) + (f_altstr != NULL ? strlen(f_altstr) : 0);
     int qlen = (f_prec > f_len ? f_prec : f_len) + nlen;
 
     if (f_flags & TH_PF_POINTER && vret == 0)