summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/pure/os.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index 7c14c46cf..1e00f92b1 100644
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -1361,7 +1361,7 @@ proc getAppFilename*(): string {.rtl, extern: "nos$1", tags: [ReadIOEffect].} =
   # /proc/<pid>/file
   when defined(windows):
     when useWinUnicode:
-      var buf = cast[WideCString](alloc(256*2))
+      var buf = newWideCString("", 256)
       var len = getModuleFileNameW(0, buf, 256)
       result = buf$len
     else: