Added defer statement
All peeks should be covered by defer now, I think
This commit is contained in:
parent
d48bcb9873
commit
f610f8c5f0
1 changed files with 1 additions and 1 deletions
|
|
@ -346,8 +346,8 @@ when not defined(js):
|
|||
|
||||
proc fsPeekData(s: Stream, buffer: pointer, bufLen: int): int =
|
||||
let pos = fsGetPosition(s)
|
||||
defer: fsSetPosition(s, pos)
|
||||
result = readBuffer(FileStream(s).f, buffer, bufLen)
|
||||
fsSetPosition(s, pos)
|
||||
|
||||
proc fsWriteData(s: Stream, buffer: pointer, bufLen: int) =
|
||||
if writeBuffer(FileStream(s).f, buffer, bufLen) != bufLen:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue