summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/fsmonitor.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/fsmonitor.nim b/lib/pure/fsmonitor.nim
index d6584c1a0..b35466771 100644
--- a/lib/pure/fsmonitor.nim
+++ b/lib/pure/fsmonitor.nim
@@ -119,8 +119,8 @@ proc getEvent(m: PFSMonitor, fd: cint): seq[TMonitorEvent] =
     var mev: TMonitorEvent
     mev.wd = event.wd
     if event.len.int != 0:
-      mev.name = newString(event.len.int)
-      copyMem(addr(mev.name[0]), addr event.name, event.len.int-1)
+      let cstr = event.name.addr.cstring
+      mev.name = $cstr
     else:
       mev.name = ""
     
@@ -211,4 +211,4 @@ when isMainModule:
       
   while true:
     if not disp.poll(): break
-  
\ No newline at end of file
+