From 50a630572805e9e55571c8dc39486ca03c08388d Mon Sep 17 00:00:00 2001 From: MysterD Date: Sat, 16 Apr 2022 14:28:15 -0700 Subject: [PATCH] more --- src/pc/mods/mods_utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pc/mods/mods_utils.c b/src/pc/mods/mods_utils.c index a1933b2d..00ec403e 100644 --- a/src/pc/mods/mods_utils.c +++ b/src/pc/mods/mods_utils.c @@ -175,8 +175,9 @@ const char* path_to_executable(void) { } GetModuleFileName(hModule, exePath, SYS_MAX_PATH-1); #else - snprintf(exePath, MAX_LAUNCH_CMD - 1, "/proc/%d/exe", getpid()); - rc = readlink(exePath, cmd, MAX_LAUNCH_CMD - 1); + char procPath[SYS_MAX_PATH] = { 0 }; + snprintf(procPath, SYS_MAX_PATH-1, "/proc/%d/exe", getpid()); + s32 rc = readlink(procPath, exePath, SYS_MAX_PATH-1); if (rc <= 0) { LOG_ERROR("unable to retrieve absolute exe path!"); return NULL;