From 5e209ca776278f32b68d1cc5e3344c7cfcb72c30 Mon Sep 17 00:00:00 2001 From: David Malone Date: Sun, 24 Jun 2001 12:08:47 +0000 Subject: [PATCH] Get rid of some constness warnings. --- sys/boot/common/load_elf.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c index e63d85e4a2c..0eddbb4b94e 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 -- 2.45.2