summary refs log tree commit diff stats
path: root/lib/system/repr.nim
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2017-05-29 17:53:20 +0200
committerArne Döring <arne.doering@gmx.net>2017-07-24 23:21:51 +0200
commit1f7fc7f279a4a1c5f4854f7c7a39a58bb2cca805 (patch)
tree15d209829c04507c2aed1579b818dda92920d55f /lib/system/repr.nim
parent52ff244d5d2775fa4d13f4e2b9a996f411281312 (diff)
downloadNim-1f7fc7f279a4a1c5f4854f7c7a39a58bb2cca805.tar.gz
arrays can now be printed
Diffstat (limited to 'lib/system/repr.nim')
-rw-r--r--lib/system/repr.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/repr.nim b/lib/system/repr.nim
index ab02c58a2..fcf65dd0e 100644
--- a/lib/system/repr.nim
+++ b/lib/system/repr.nim
@@ -18,7 +18,7 @@ proc reprFloat(x: float): string {.compilerproc.} = return $x
 proc reprPointer(x: pointer): string {.compilerproc.} =
   var buf: array[0..59, char]
   discard c_sprintf(buf, "%p", x)
-  return $buf
+  return newString(buf)
 
 proc `$`(x: uint64): string =
   if x == 0:
@@ -36,7 +36,7 @@ proc `$`(x: uint64): string =
     let half = i div 2
     # Reverse
     for t in 0 .. < half: swap(buf[t], buf[i-t-1])
-    result = $buf
+    result = newString(buf)
 
 proc reprStrAux(result: var string, s: cstring; len: int) =
   if cast[pointer](s) == nil: