modprobe-small: fix safe_strncpy truncating last char of module name
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 91e0c13..b7990bf 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -297,7 +297,7 @@
char name[MODULE_NAME_LEN];
const char *fname = bb_get_last_path_component_nostrip(pathname);
const char *suffix = strrstr(fname, ".ko");
- safe_strncpy(name, fname, suffix - fname);
+ safe_strncpy(name, fname, suffix - fname + 1);
replace(name, '-', '_');
r = (strcmp(name, modname) == 0);
return r;