Tcl Source Code

Artifact [1397f12901]
Login

Artifact 1397f129011b5ab74a83989f26aa06047f872feeca6a53bfca7fe50b364148c3:

Attachment "0001-generic-tcl.h-use-Tcl_WideInt-for-seconds-in-Tcl_Tim.patch" to ticket [86dd172271] added by kanavin 2023-08-23 13:41:49. (unpublished)
From ff508f2e6786df697876140f21855ecb92a3ed36 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <[email protected]>
Date: Fri, 18 Aug 2023 12:25:11 +0200
Subject: [PATCH] generic/tcl.h: use Tcl_WideInt for seconds in Tcl_Time

This ensures the value will not overflow, particularly on 32 bit systems
in 2038, where long will.

---
 generic/tcl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generic/tcl.h b/generic/tcl.h
index 3a4622e..6204c57 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -1418,7 +1418,7 @@ typedef enum {
  */
 
 typedef struct Tcl_Time {
-    long sec;			/* Seconds. */
+    Tcl_WideInt sec;			/* Seconds. */
     long usec;			/* Microseconds. */
 } Tcl_Time;