From 4ae9486eef1fcddc1e38c9196df4bc729bee9522 Mon Sep 17 00:00:00 2001 From: Billingsly Wetherfordshire Date: Mon, 2 Jun 2014 18:21:37 -0500 Subject: fix #1241 --- lib/pure/fsmonitor.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 + -- cgit 1.4.1-2-gfad0