From f2c5676767fd9d9d25fc671a5be4577d029a8a16 Mon Sep 17 00:00:00 2001 From: Charles Blake Date: Tue, 28 Jul 2015 06:45:07 -0400 Subject: [PATCH] Remove NUL termination unneeded post toNimStr fix. --- lib/pure/memfiles.nim | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/pure/memfiles.nim b/lib/pure/memfiles.nim index 4f92b0e2f5..90797ecc62 100644 --- a/lib/pure/memfiles.nim +++ b/lib/pure/memfiles.nim @@ -273,7 +273,6 @@ iterator memSlices*(mfile: MemFile, delim='\l', eat='\r'): MemSlice {.inline.} = proc toString*(ms: MemSlice): string {.inline.} = proc toNimStr(str: cstring, len: int): string {. importc: "toNimStr" .} result = toNimStr(cast[cstring](ms.data), ms.size) - result[result.len] = '\0' # toNimStr copies 1 extra byte but does not NUL-term iterator lines*(mfile: MemFile): string {.inline.} = for ms in memSlices(mfile): yield toString(ms)