about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-01-01 00:45:32 +0100
committerbptato <nincsnevem662@gmail.com>2023-01-01 00:46:19 +0100
commit27577126acacfc531cacaaa8b8da684c97dc4b12 (patch)
treecc9343447d7a66e3a74b4aa8ed7c10c0bedd8e0a /src
parentb155fd2a274bd02184d999b8ac186abcbcd4c19a (diff)
downloadchawan-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.nim2
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