From 6fa04d74e058900e8929c9cbb45c994145691d6b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 19 Dec 2019 22:09:46 +0000 Subject: Add type-cast, making sure that the unary minus is handled correctly on any compiler --- generic/tclUtil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclUtil.c b/generic/tclUtil.c index f858bb4..874e2a5 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -3335,7 +3335,7 @@ TclFormatInt(buffer, n) * Generate the characters of the result backwards in the buffer. */ - intVal = (n < 0 ? -n : n); + intVal = (n < 0 ? -(unsigned long)n : (unsigned long)n); i = 0; buffer[0] = '\0'; do { -- cgit v0.12