fix: windows assertion failure due to incorrect path length (#22324)

This commit fixes an assertion failure on windows debug builds that was
introduced in https://github.com/neovim/neovim/pull/22128 .
This commit is contained in:
Ghjuvan Lacambre 2023-02-19 13:25:29 +01:00 committed by GitHub
parent cbd4480f97
commit c726585ce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1607,7 +1607,7 @@ char *runtimepath_default(bool clean_arg)
data_len = strlen(data_home); data_len = strlen(data_home);
size_t nvim_data_size = appname_len; size_t nvim_data_size = appname_len;
#if defined(MSWIN) #if defined(MSWIN)
nvim_data_size += sizeof("-data"); nvim_data_size += sizeof("-data") - 1; // -1: NULL byte should be ignored
#endif #endif
if (data_len != 0) { if (data_len != 0) {
rtp_size += ((data_len + memcnt(data_home, ',', data_len) rtp_size += ((data_len + memcnt(data_home, ',', data_len)