diff options
| author | David Malone <dwmalone@FreeBSD.org> | 2001-06-24 12:08:47 +0000 |
|---|---|---|
| committer | David Malone <dwmalone@FreeBSD.org> | 2001-06-24 12:08:47 +0000 |
| commit | 5e209ca776278f32b68d1cc5e3344c7cfcb72c30 (patch) | |
| tree | 45bfac0d8c80f71b0172cca487fc4a1e37d921a4 /sys/boot/common/load_elf.c | |
| parent | a933327c4b1951169c587474cc2c10bf0f82cd8a (diff) | |
Notes
Diffstat (limited to 'sys/boot/common/load_elf.c')
| -rw-r--r-- | sys/boot/common/load_elf.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index e63d85e4a2c9..0eddbb4b94ed 100644 --- a/sys/boot/common/load_elf.c +++ b/sys/boot/common/load_elf.c @@ -540,7 +540,8 @@ static char invalid_name[] = "bad"; char * fake_modname(const char *name) { - char *sp, *ep; + const char *sp, *ep; + char *fp; size_t len; sp = strrchr(name, '/'); @@ -557,12 +558,12 @@ fake_modname(const char *name) } else ep = name + strlen(name); len = ep - sp; - ep = malloc(len + 1); - if (ep == NULL) + fp = malloc(len + 1); + if (fp == NULL) return NULL; - memcpy(ep, sp, len); - ep[len] = '\0'; - return ep; + memcpy(fp, sp, len); + fp[len] = '\0'; + return fp; } int |
