Fix wrong name len when converting path to modname

This commit is contained in:
Lucas De Marchi 2011-12-18 15:12:19 -02:00
parent b6ea28dda4
commit 9dec24462d

View File

@ -366,7 +366,7 @@ KMOD_EXPORT int kmod_module_new_from_path(struct kmod_ctx *ctx,
m->ctx = kmod_ref(ctx);
m->name = (char *)m + sizeof(*m);
memcpy(m->name, name, namelen);
memcpy(m->name, name, namelen + 1);
m->path = abspath;
m->hashkey = m->name;
m->refcount = 1;