From 1cfc468e5cbb7e703d7e39b6eadb614772fa81cb Mon Sep 17 00:00:00 2001 From: Nicolas Hillegeer Date: Tue, 22 Jul 2014 21:10:12 +0200 Subject: test/helpers: allow interning Pascal strings os_system() returns a Pascal string, for example (it also NUL-terminates the string, but that's neither here nor there). --- test/unit/helpers.moon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/unit/helpers.moon b/test/unit/helpers.moon index 438f36811c..8064537d93 100644 --- a/test/unit/helpers.moon +++ b/test/unit/helpers.moon @@ -88,9 +88,9 @@ cimport './src/nvim/types.h' -- take a pointer to a C-allocated string and return an interned -- version while also freeing the memory -internalize = (cdata) -> +internalize = (cdata, len) -> ffi.gc cdata, ffi.C.free - return ffi.string cdata + return ffi.string cdata, len cstr = ffi.typeof 'char[?]' -- cgit