From 7ddfc42ee3ab330fa51b10768bee94a140750a1f Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 3 Oct 2022 15:10:37 -0400 Subject: [PATCH] * src/misc.c (make_lltoa): Use printf format macro from makeint.h (make_ulltoa): Ditto. --- src/misc.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/misc.c b/src/misc.c index 48e4cb5e..011e4f22 100644 --- a/src/misc.c +++ b/src/misc.c @@ -54,27 +54,21 @@ make_toui (const char *str, const char **error) return val; } -#if WINDOWS32 - /* MSVCRT does not support the 'll' format specifier. */ -# define LLFMT "I64" -#else -# define LLFMT "ll" -#endif - /* Convert val into a string, written to buf. buf must be large enough - to hold the largest possible value, plus a nul byte. Returns buf. */ + to hold the largest possible value, plus a nul byte. Returns buf. + We can't use standard PRI* here: those are based on intNN_t types. */ char * make_lltoa (long long val, char *buf) { - sprintf (buf, "%" LLFMT "d", val); + sprintf (buf, "%" MK_PRI64_PREFIX "d", val); return buf; } char * make_ulltoa (unsigned long long val, char *buf) { - sprintf (buf, "%" LLFMT "u", val); + sprintf (buf, "%" MK_PRI64_PREFIX "u", val); return buf; }