changeset 725:5c8936e326d6

On 64bit 'l' printf specifier is 64bit, on 32bit 'll' is 64bit.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 18 Oct 2021 01:56:55 +0300
parents 388d72f4189d
children 29e44a58bc73
files th_printf.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/th_printf.c	Mon Oct 18 01:56:09 2021 +0300
+++ b/th_printf.c	Mon Oct 18 01:56:55 2021 +0300
@@ -499,13 +499,18 @@
             switch (*fmt)
             {
                 case 'l':
-                    if (*++fmt == 'l')
+                    fmt++;
+                    if (*fmt == 'l')
                     {
                         f_flags |= TH_PF_LONGLONG;
                         fmt++;
                     }
                     else
+#if TH_ARCH == 64
+                        f_flags |= TH_PF_LONGLONG;
+#else
                         f_flags |= TH_PF_LONG;
+#endif
                     break;
 
                 case 'L':