From 290988d75c46a8e3f2d7278253831a1af61e3f20 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Fri, 7 Feb 2020 18:18:35 +0100 Subject: [PATCH] Terminate cstr with \0 --- NvimView/NvimServer/server.c | 2 +- VimR/VimR/FileScanBaton.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NvimView/NvimServer/server.c b/NvimView/NvimServer/server.c index 9052ef42..e4cd4f0c 100644 --- a/NvimView/NvimServer/server.c +++ b/NvimView/NvimServer/server.c @@ -379,7 +379,7 @@ static const char *cfstr2cstr(CFStringRef cfstr, bool *free_bytes) { } *free_bytes = true; - result[out_len] = NULL; + result[out_len] = '\0'; return result; } diff --git a/VimR/VimR/FileScanBaton.m b/VimR/VimR/FileScanBaton.m index 5e150395..6cec1353 100644 --- a/VimR/VimR/FileScanBaton.m +++ b/VimR/VimR/FileScanBaton.m @@ -167,7 +167,7 @@ static const char *cfstr_to_cstr_copy(CFStringRef cfstr) { return NULL; } - result[out_len] = NULL; + result[out_len] = '\0'; return result; }