diff options
author | Araq <rumpf_a@web.de> | 2012-06-28 08:33:25 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-06-28 08:33:25 +0200 |
commit | 2900ceae3580a9f1e83b500cf1abcdfe77762cad (patch) | |
tree | 1279b1199dcd7f1af2949355e692b1857960a0ee /lib/system/sysio.nim | |
parent | b5d34242ca7156ec702f8e63a01c9cd059d28e5f (diff) | |
download | Nim-2900ceae3580a9f1e83b500cf1abcdfe77762cad.tar.gz |
changed integer promotion rules; added math.fmod
Diffstat (limited to 'lib/system/sysio.nim')
-rwxr-xr-x | lib/system/sysio.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index adcb32b42..15f87896a 100755 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -199,8 +199,8 @@ proc Open(f: var TFile, filename: string, var p: pointer = fopen(filename, FormatOpen[mode]) result = (p != nil) f = cast[TFile](p) - if bufSize > 0: - if setvbuf(f, nil, IOFBF, bufSize) != 0'i32: + if bufSize > 0 and bufSize <= high(cint): + if setvbuf(f, nil, IOFBF, bufSize.cint) != 0'i32: raise newException(EOutOfMemory, "out of memory") elif bufSize == 0: discard setvbuf(f, nil, IONBF, 0) |