From 2dd514d0f928f4ab62d50a94e9758d2b2795a19d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Fri, 16 Feb 2024 04:10:49 -0500
Subject: [PATCH] Use strtoull() converting a string to a size_t

Except on Borland, which presumably doesn't have strtoull().
---
 src/xpdev/xpprintf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/xpdev/xpprintf.c b/src/xpdev/xpprintf.c
index 7b7c813933..3fd3b3b699 100644
--- a/src/xpdev/xpprintf.c
+++ b/src/xpdev/xpprintf.c
@@ -1150,7 +1150,11 @@ char* xp_asprintf_next(char *format, int type, ...)
 							break;
 #endif
 						case XP_PRINTF_TYPE_CHARP:
-							s=strtol(cp, NULL, 0);	/* was strtoll */
+#if defined(__BORLANDC__)
+							s=strtoul(cp, NULL, 0);
+#else
+							s=strtoull(cp, NULL, 0);
+#endif
 							break;
 						case XP_PRINTF_TYPE_DOUBLE:
 							s=(size_t)d;
-- 
GitLab