diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2001-06-24 12:08:47 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2001-06-24 12:08:47 +0000 |
commit | 238662ef2f525a2d6bba9e46aa736b82aa2dc7fa (patch) | |
tree | 45bfac0d8c80f71b0172cca487fc4a1e37d921a4 /sys | |
parent | 2a93d1e87003ea72ee66442e9b6fd95d681c5dad (diff) | |
download | FreeBSD-src-238662ef2f525a2d6bba9e46aa736b82aa2dc7fa.zip FreeBSD-src-238662ef2f525a2d6bba9e46aa736b82aa2dc7fa.tar.gz |
Get rid of some constness warnings.
Diffstat (limited to 'sys')
-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 e63d85e..0eddbb4 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 |