changeset 538:5c9e65b74f8d

Add more explanation for the reasoning behind the special casing of 0.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 30 Dec 2019 15:04:24 +0200
parents 7fd1c51f3b18
children 7615dbdc4d34
files th_printf1.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/th_printf1.c	Mon Dec 30 15:03:55 2019 +0200
+++ b/th_printf1.c	Mon Dec 30 15:04:24 2019 +0200
@@ -29,7 +29,9 @@
     // Render the value to a string in buf (reversed)
     TH_PFUNC_TYPE_U val = pval;
 
-    // Special case for value of 0
+    // Special case for value of 0. This would seem like a
+    // dirty kludge, but allows us to handle NULL ptr (nul)
+    // situation a bit better elsewhere.
     if (val == 0)
         return 0;