fixes more nil string bugs

This commit is contained in:
Araq 2018-08-08 18:22:48 +02:00
commit babd31360a
3 changed files with 10 additions and 8 deletions

View file

@ -110,6 +110,7 @@ proc nimToCStringConv(s: NimString): cstring {.compilerProc, inline.} =
else: result = cstring(addr s.data)
proc copyStr(s: NimString, start: int): NimString {.compilerProc.} =
if s == nil: return nil
result = copyStrLast(s, start, s.len-1)
proc toNimStr(str: cstring, len: int): NimString {.compilerProc.} =