Fixes #3752.
This commit is contained in:
parent
3b732259c0
commit
a70e6b3fde
2 changed files with 5 additions and 0 deletions
|
|
@ -58,6 +58,8 @@ proc readBytes(f: File, a: var openArray[int8|uint8], start, len: Natural): int
|
|||
result = readBuffer(f, addr(a[start]), len)
|
||||
|
||||
proc readChars(f: File, a: var openArray[char], start, len: Natural): int =
|
||||
if (start + len) > len(a):
|
||||
raiseEIO("buffer overflow: (start+len) > length of openarray buffer")
|
||||
result = readBuffer(f, addr(a[start]), len)
|
||||
|
||||
proc write(f: File, c: cstring) = fputs(c, f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue