mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-05 11:24:08 +00:00
fixes #9456 by only calling c_fclose if non nil
This commit is contained in:
@@ -130,7 +130,10 @@ else:
|
||||
const
|
||||
BufSize = 4000
|
||||
|
||||
proc close*(f: File) = discard c_fclose(f)
|
||||
proc close*(f: File) =
|
||||
if not f.isNil:
|
||||
discard c_fclose(f)
|
||||
|
||||
proc readChar(f: File): char =
|
||||
let x = c_fgetc(f)
|
||||
if x < 0:
|
||||
|
||||
Reference in New Issue
Block a user