From 05df5dfbf2e663f95ffdcea6b31d94c68c6d1cde Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 17 Dec 2019 01:17:49 -0500 Subject: [PATCH] buffer bit --- sys/winnt/windmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/winnt/windmain.c b/sys/winnt/windmain.c index b447ffcbd..010c11eda 100644 --- a/sys/winnt/windmain.c +++ b/sys/winnt/windmain.c @@ -197,8 +197,8 @@ test_portable_config( */ *portable_device_top_path = '\0'; - (void) strncpy(tmppath, executable_path, sizeof tmppath - 1); - tmppath[sizeof tmppath - 1] = '\0'; + (void) strncpy(tmppath, executable_path, sizeof tmppath - (1 + sizeof "sysconf")); + tmppath[sizeof tmppath - (1 + sizeof "sysconf")] = '\0'; (void) strcat(tmppath, "sysconf"); /* split the path up */ #ifdef UNICODE -- 2.40.0