From b0bdff5216fcf02df7ba51716f50e15a0140dcf0 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 17 Jul 2002 12:51:48 +0000 Subject: [PATCH] Small fix to prevent a segfault. Provide more info when a duplicate module name is detected during a scan. Remove some code we no longer use. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@274 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/module.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kernel/core/module.c b/src/kernel/core/module.c index a31cc8b527..3ac8830dec 100644 --- a/src/kernel/core/module.c +++ b/src/kernel/core/module.c @@ -324,7 +324,7 @@ static int simple_module_info(module_info *mod, const char *file, int offset) m = (module*)hash_lookup(modules_list, mod->name); if (m) { - dprintf("Duplicate module name detected...ignoring\n"); + dprintf("Duplicate module name (%s) detected...ignoring\n", mod->name); return -1; } @@ -343,7 +343,7 @@ static int simple_module_info(module_info *mod, const char *file, int offset) kfree(m); return -1; } - memcpy(m->name, mod->name, strlen(mod->name));//strdup(mod->name); + memcpy(m->name, mod->name, strlen(mod->name)); m->state = MOD_QUERIED; /* Record where the module_info can be found */ m->offset = offset; @@ -391,10 +391,10 @@ static int recurse_check_file(const char *filepath, const char *srcfile) } for (chk = hdr; *chk; chk++) { - if ((res = simple_module_info(*chk, filepath, i++)) != 0) - continue; - if (srcfile && strcmp((*chk)->name, srcfile) == 0) - res = 1; + if ((res = simple_module_info(*chk, filepath, i++)) != 0) { + if (srcfile && strcmp((*chk)->name, srcfile) == 0) + res = 1; + } } if (res != 1)