mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 13:07:48 +00:00
Revert toNimStr fix as per Araq request.
This commit is contained in:
@@ -82,8 +82,7 @@ proc copyStr(s: NimString, start: int): NimString {.compilerProc.} =
|
||||
proc toNimStr(str: cstring, len: int): NimString {.compilerProc.} =
|
||||
result = rawNewStringNoInit(len)
|
||||
result.len = len
|
||||
c_memcpy(result.data, str, len)
|
||||
result.data[len] = '\0'
|
||||
c_memcpy(result.data, str, len + 1)
|
||||
|
||||
proc cstrToNimstr(str: cstring): NimString {.compilerRtl.} =
|
||||
result = toNimStr(str, c_strlen(str))
|
||||
|
||||
Reference in New Issue
Block a user