diff --git a/infra/module_manager/module_manager.c b/infra/module_manager/module_manager.c index 077231e..2a89f07 100644 --- a/infra/module_manager/module_manager.c +++ b/infra/module_manager/module_manager.c @@ -213,7 +213,7 @@ struct stellar_module *stellar_module_manager_get_module(struct stellar_module_m struct stellar_module *stellar_module_new(const char *name) { struct stellar_module *mod = CALLOC(struct stellar_module, 1); - strncpy(mod->name, name, NAME_MAX); + memcpy(mod->name, name, MIN(NAME_MAX, strlen(name))); return mod; } @@ -246,6 +246,6 @@ const char *stellar_module_get_name(struct stellar_module* mod) void stellar_module_set_name(struct stellar_module* mod, const char *name) { if(mod==NULL)return; - strncpy(mod->name, name, NAME_MAX); + memcpy(mod->name, name, MIN(NAME_MAX, strlen(name))); return; } \ No newline at end of file