summary refs log tree commit diff stats
path: root/lib/system/widestrs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/widestrs.nim')
-rw-r--r--lib/system/widestrs.nim7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/system/widestrs.nim b/lib/system/widestrs.nim
index 5a30a7c0f..6ad0cfd58 100644
--- a/lib/system/widestrs.nim
+++ b/lib/system/widestrs.nim
@@ -104,12 +104,7 @@ proc newWideCString*(source: cstring, L: int): WideCString =
 proc newWideCString*(s: cstring): WideCString =
   if s.isNil: return nil
 
-  when not declared(c_strlen):
-    proc c_strlen(a: cstring): int {.
-      header: "<string.h>", noSideEffect, importc: "strlen".}
-
-  let L = c_strlen(s)
-  result = newWideCString(s, L)
+  result = newWideCString(s, s.len)
 
 proc newWideCString*(s: string): WideCString =
   result = newWideCString(s, s.len)