mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-05 11:24:08 +00:00
Fix for cstring nil to string nil conversion with $
This commit is contained in:
@@ -85,7 +85,8 @@ proc toNimStr(str: cstring, len: int): NimString {.compilerProc.} =
|
||||
copyMem(addr(result.data), str, len + 1)
|
||||
|
||||
proc cstrToNimstr(str: cstring): NimString {.compilerRtl.} =
|
||||
result = toNimStr(str, str.len)
|
||||
if str == nil: NimString(nil)
|
||||
else: toNimStr(str, str.len)
|
||||
|
||||
proc copyString(src: NimString): NimString {.compilerRtl.} =
|
||||
if src != nil:
|
||||
|
||||
Reference in New Issue
Block a user