diff options
author | Bung <crc32@qq.com> | 2022-12-16 15:01:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-16 08:01:15 +0100 |
commit | a9bd78d579168ba50f42d3bc418cd7de70a226f9 (patch) | |
tree | 0d86451a7c502ca87855107d5928b460823a8c11 /lib/std/syncio.nim | |
parent | 8a3b76b28733a87e5cffa3f4b7b99d76f13ee2ba (diff) | |
download | Nim-a9bd78d579168ba50f42d3bc418cd7de70a226f9.tar.gz |
fix #12122 (#21096)
Diffstat (limited to 'lib/std/syncio.nim')
-rw-r--r-- | lib/std/syncio.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/syncio.nim b/lib/std/syncio.nim index 2b5ea6a3c..46f113450 100644 --- a/lib/std/syncio.nim +++ b/lib/std/syncio.nim @@ -480,7 +480,7 @@ proc readLine*(f: File, line: var string): bool {.tags: [ReadIOEffect], let m = c_memchr(addr line[pos], '\L'.ord, cast[csize_t](sp)) if m != nil: # \l found: Could be our own or the one by fgets, in any case, we're done - var last = cast[ByteAddress](m) - cast[ByteAddress](addr line[0]) + var last = cast[int](m) - cast[int](addr line[0]) if last > 0 and line[last-1] == '\c': line.setLen(last-1) return last > 1 or fgetsSuccess |