Oops..[]= not defined yet here. Use .data instead.
This commit is contained in:
parent
18df5dad11
commit
a2b6a630fe
1 changed files with 1 additions and 1 deletions
|
|
@ -83,7 +83,7 @@ proc toNimStr(str: cstring, len: int): NimString {.compilerProc.} =
|
|||
result = rawNewStringNoInit(len)
|
||||
result.len = len
|
||||
c_memcpy(result.data, str, len)
|
||||
result[result.len] = '\0'
|
||||
result.data[len] = '\0'
|
||||
|
||||
proc cstrToNimstr(str: cstring): NimString {.compilerRtl.} =
|
||||
result = toNimStr(str, c_strlen(str))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue