From b3484088e963982a0d17451c5cfcad69697c26db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 17 Dec 2023 11:46:28 +0800 Subject: [PATCH] FFPlatform (Linux): tidy --- src/util/platform/FFPlatform_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/platform/FFPlatform_unix.c b/src/util/platform/FFPlatform_unix.c index 04687f0be..f224c84eb 100644 --- a/src/util/platform/FFPlatform_unix.c +++ b/src/util/platform/FFPlatform_unix.c @@ -20,7 +20,7 @@ static void getExePath(FFPlatform* platform) FFstrbuf* const exePath = &platform->exePath; ffStrbufEnsureFree(exePath, PATH_MAX); #ifdef __linux__ - ssize_t exePathLen = readlink("/proc/self/exe", exePath->chars, exePath->allocated); + ssize_t exePathLen = readlink("/proc/self/exe", exePath->chars, exePath->allocated - 1); #elif defined(__APPLE__) int exePathLen = proc_pidpath((int) getpid(), exePath->chars, exePath->allocated); #elif defined(__FreeBSD__)