mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Settings (FreeBSD): don't append trailing \0
This commit is contained in:
@@ -13,6 +13,7 @@ Features:
|
||||
Bugfixes:
|
||||
* Fix support of macOS Sonoma (Wallpaper, macOS)
|
||||
* Fix overall memory leaks (macOS)
|
||||
* Remove trailing `\0` in JSON results (FreeBSD)
|
||||
|
||||
# 2.5.0
|
||||
|
||||
|
||||
@@ -411,9 +411,8 @@ bool ffSettingsGetFreeBSDKenv(const char* propName, FFstrbuf* result)
|
||||
//https://wiki.ghostbsd.org/index.php/Kenv
|
||||
ffStrbufEnsureFree(result, KENV_MVALLEN);
|
||||
int len = kenv(KENV_GET, propName, result->chars + result->length, KENV_MVALLEN);
|
||||
if (len <= 0) return false;
|
||||
result->length += (uint32_t) len;
|
||||
result->chars[result->length] = '\0';
|
||||
if (len <= 1) return false; // number of bytes copied, including NUL terminator
|
||||
result->length += (uint32_t) len - 1;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user