diff --git a/src/detection/brightness/brightness_linux.c b/src/detection/brightness/brightness_linux.c index 678c89a6a..da6825111 100644 --- a/src/detection/brightness/brightness_linux.c +++ b/src/detection/brightness/brightness_linux.c @@ -41,7 +41,7 @@ static const char* detectWithBacklight(FFlist* result) FFBrightnessResult* brightness = (FFBrightnessResult*) ffListAdd(result); ffStrbufSubstrBeforeLastC(&backlightDir, '/'); ffStrbufAppendS(&backlightDir, "/device"); - ffStrbufInitA(&brightness->name, PATH_MAX + 1); + ffStrbufInitA(&brightness->name, PATH_MAX); if(realpath(backlightDir.chars, brightness->name.chars)) { ffStrbufRecalculateLength(&brightness->name); diff --git a/src/util/platform/FFPlatform_unix.c b/src/util/platform/FFPlatform_unix.c index 85e624a0d..5badc958b 100644 --- a/src/util/platform/FFPlatform_unix.c +++ b/src/util/platform/FFPlatform_unix.c @@ -22,7 +22,7 @@ static void getExePath(FFPlatform* platform) { - char exePath[PATH_MAX + 1]; + char exePath[PATH_MAX]; #if defined(__linux__) || defined (__GNU__) ssize_t exePathLen = readlink("/proc/self/exe", exePath, sizeof(exePath) - 1); if (exePathLen >= 0) @@ -58,7 +58,7 @@ static void getExePath(FFPlatform* platform) while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) { if (info.type == B_APP_IMAGE) { - exePathLen = strlcpy(exePath, info.name, PATH_MAX); + exePathLen = strlcpy(exePath, info.name, sizeof(exePath)); break; } }