aboutsummaryrefslogtreecommitdiff
path: root/src/defaultIO.nim
diff options
context:
space:
mode:
authorJulien Dessaux2021-10-08 23:11:06 +0200
committerJulien Dessaux2021-10-08 23:11:06 +0200
commit4863af23b5280354293524191cba82f09403b741 (patch)
treecfd510775bc16cbe011aa42ec789008a16e284b1 /src/defaultIO.nim
parentCosmetics (diff)
downloadnimfunge98-4863af23b5280354293524191cba82f09403b741.tar.gz
nimfunge98-4863af23b5280354293524191cba82f09403b741.tar.bz2
nimfunge98-4863af23b5280354293524191cba82f09403b741.zip
Fixed failing mycology tests
Diffstat (limited to 'src/defaultIO.nim')
-rw-r--r--src/defaultIO.nim5
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} ")