fixes incorrect cint overflow in system (#22718)

fixes #22700
This commit is contained in:
ringabout
2023-09-18 16:00:46 +08:00
committed by GitHub
parent deefbc420e
commit 63c2ea5566
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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)