diff --git a/sched/module/mod_insmod.c b/sched/module/mod_insmod.c index 82c0a27c2e..e63f0132a2 100644 --- a/sched/module/mod_insmod.c +++ b/sched/module/mod_insmod.c @@ -198,9 +198,11 @@ FAR void *insmod(FAR const char *filename, FAR const char *modname) goto errout_with_loadinfo; } +#ifdef HAVE_MODLIB_NAMES /* Save the module name in the registry entry */ - strlcpy(modp->modname, modname, MODLIB_NAMEMAX); + strlcpy(modp->modname, modname, sizeof(modp->modname)); +#endif /* Load the program binary */