summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-09-18 16:00:46 +0800
committerGitHub <noreply@github.com>2023-09-18 10:00:46 +0200
commit63c2ea5566cc7a0983cc748a3d4855d24beeebda (patch)
treed507fb273ba2dc22fece04363d049304344988dc /lib
parentdeefbc420e218459ffc6ccf915f625cd48e083b4 (diff)
downloadNim-63c2ea5566cc7a0983cc748a3d4855d24beeebda.tar.gz
fixes incorrect cint overflow in system (#22718)
fixes #22700
Diffstat (limited to 'lib')
-rw-r--r--lib/std/syncio.nim2
-rw-r--r--lib/system.nim2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/syncio.nim b/lib/std/syncio.nim
index 879301f8a..498b2b5a4 100644
--- a/lib/std/syncio.nim
+++ b/lib/std/syncio.nim
@@ -246,7 +246,7 @@ when defined(windows):
     # machine. We also enable `setConsoleOutputCP(65001)` now by default.
     # But we cannot call printf directly as the string might contain \0.
     # So we have to loop over all the sections separated by potential \0s.
-    var i = c_fprintf(f, "%s", s)
+    var i = int c_fprintf(f, "%s", s)
     while i < s.len:
       if s[i] == '\0':
         let w = c_fputc('\0', f)
diff --git a/lib/system.nim b/lib/system.nim
index 4949430a3..633f637ca 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2788,7 +2788,7 @@ when notJSnotNims:
             # machine. We also enable `setConsoleOutputCP(65001)` now by default.
             # But we cannot call printf directly as the string might contain \0.
             # So we have to loop over all the sections separated by potential \0s.
-            var i = c_fprintf(f, "%s", s)
+            var i = int c_fprintf(f, "%s", s)
             while i < s.len:
               if s[i] == '\0':
                 let w = c_fputc('\0', f)