mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 19:52:36 +00:00
fixes incorrect cint overflow in system (#22718)
fixes #22700
(cherry picked from commit 63c2ea5566)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -2774,7 +2774,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)
|
||||
|
||||
Reference in New Issue
Block a user