diff options
Diffstat (limited to '')
-rw-r--r-- | src/defaultIO.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/defaultIO.nim b/src/defaultIO.nim index ccf4476..1c3e2ca 100644 --- a/src/defaultIO.nim +++ b/src/defaultIO.nim @@ -34,7 +34,10 @@ proc defaultDecimalInput*(): int = return result proc defaultCharacterOutput*(v: int) = - discard stdout.writeChars(@[v.char()], 0, 1) + try: + discard stdout.writeChars(@[v.char()], 0, 1) + except RangeDefect: + discard stdout.writeBuffer(unsafeAddr v, 4) proc defaultDecimalOutput*(v: int) = stdout.write(&"{v} ") |