summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/system/gc.nim2
-rwxr-xr-xlib/system/sysstr.nim2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/gc.nim b/lib/system/gc.nim
index 02782cdd0..b692732ca 100755
--- a/lib/system/gc.nim
+++ b/lib/system/gc.nim
@@ -420,7 +420,7 @@ proc newObjRC1(typ: PNimType, size: int): pointer {.compilerRtl.} =
     if framePtr != nil and framePtr.prev != nil:
       res.filename = framePtr.prev.filename
       res.line = framePtr.prev.line
-  res.refcount = rcIncrement # refcount is 1  
+  res.refcount = rcIncrement # refcount is 1
   sysAssert(isAllocatedPtr(gch.region, res), "newObj: 3")
   when logGC: writeCell("new cell", res)
   gcTrace(res, csAllocated)
diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim
index b0843fc11..b8ce687e0 100755
--- a/lib/system/sysstr.nim
+++ b/lib/system/sysstr.nim
@@ -52,7 +52,7 @@ proc copyStrLast(s: NimString, start, last: int): NimString {.compilerProc.} =
     c_memcpy(result.data, addr(s.data[start]), len * sizeof(Char))
     result.data[len] = '\0'
   else:
-    result = mnewString(0)
+    result = rawNewString(len)
 
 proc copyStr(s: NimString, start: int): NimString {.compilerProc.} =
   result = copyStrLast(s, start, s.len-1)