summary refs log tree commit diff stats
path: root/lib/system/memory.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/memory.nim')
-rw-r--r--lib/system/memory.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/system/memory.nim b/lib/system/memory.nim
index ebda60d8d..156773c48 100644
--- a/lib/system/memory.nim
+++ b/lib/system/memory.nim
@@ -43,6 +43,7 @@ proc nimCmpMem*(a, b: pointer, size: Natural): cint {.compilerproc, nonReloadabl
       inc i
 
 proc nimCStrLen*(a: cstring): int {.compilerproc, nonReloadable, inline.} =
+  if a.isNil: return 0
   when useLibC:
     cast[int](c_strlen(a))
   else: