diff options
-rw-r--r-- | lib/system/sysstr.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim index e4673b169..9c98f8416 100644 --- a/lib/system/sysstr.nim +++ b/lib/system/sysstr.nim @@ -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)) |