From 7d7f02d1be31e14c27a64b6a3746601e28c94dec Mon Sep 17 00:00:00 2001 From: anth64 Date: Sun, 2 Nov 2025 12:44:10 +0100 Subject: [PATCH] use a constant for the mod dir buffer size --- include/stk.h | 2 ++ src/module.c | 2 +- src/stk.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/stk.h b/include/stk.h index 5df0dac..1097a45 100644 --- a/include/stk.h +++ b/include/stk.h @@ -4,6 +4,8 @@ #include "stk_version.h" #include +#define MOD_DIR_BUFFER_SIZE 32 + #ifdef __cplusplus extern "C" { #endif diff --git a/src/module.c b/src/module.c index 30a721a..13d5971 100644 --- a/src/module.c +++ b/src/module.c @@ -7,7 +7,7 @@ void *platform_get_symbol(void *handle, const char *symbol); typedef void (*stk_module_func)(void); -char *stk_mod_dir = NULL; +char stk_mod_dir[MOD_DIR_BUFFER_SIZE]; static void **stk_handles = NULL; static stk_module_func *stk_inits = NULL; static stk_module_func *stk_shutdowns = NULL; diff --git a/src/stk.c b/src/stk.c index acbd924..f472b55 100644 --- a/src/stk.c +++ b/src/stk.c @@ -1,7 +1,7 @@ #include "stk.h" #include "stk_log.h" -extern char *stk_mod_dir; +extern char stk_mod_dir[MOD_DIR_BUFFER_SIZE]; int stk_init(const char *mod_dir) {