diff options
author | bptato <nincsnevem662@gmail.com> | 2023-01-01 00:45:32 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-01-01 00:46:19 +0100 |
commit | 27577126acacfc531cacaaa8b8da684c97dc4b12 (patch) | |
tree | cc9343447d7a66e3a74b4aa8ed7c10c0bedd8e0a /src | |
parent | b155fd2a274bd02184d999b8ac186abcbcd4c19a (diff) | |
download | chawan-27577126acacfc531cacaaa8b8da684c97dc4b12.tar.gz |
posixstream: fix incorrect read() usage
It was overwriting our buffer, instead of appending to it...
Diffstat (limited to 'src')
-rw-r--r-- | src/io/posixstream.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/io/posixstream.nim b/src/io/posixstream.nim index 8378c194..fa0a35ca 100644 --- a/src/io/posixstream.nim +++ b/src/io/posixstream.nim @@ -34,7 +34,7 @@ proc psReadData(s: Stream, buffer: pointer, len: int): int = assert len != 0 let s = cast[PosixStream](s) while result < len: - let n = read(s.fd, buffer, len) + let n = read(s.fd, cast[pointer](cast[int](buffer) + result), len) if n < 0: if result == 0: result = n |