Skip to content

Commit ce6f2b5

Browse files
nvinsonDaniel Kiper
authored andcommitted
util/resolve: Save str[r]chr() ret val to const data ptr
With glibc-2.43 implementing the C23 standard, strrchr() and strchr() now return "const char *" when its first argument is "const char *". The fix is update all pointers receiving strrchr() and strchr()'s return values so that they are now "const char *" instead of "char *". Signed-off-by: Nicholas Vinson <nvinson234@gmail.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
1 parent 9f4a586 commit ce6f2b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

util/resolve.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ read_dep_list (FILE *fp)
138138
static char *
139139
get_module_name (const char *str)
140140
{
141-
char *base;
142-
char *ext;
141+
const char *base;
142+
const char *ext;
143143

144144
base = strrchr (str, '/');
145145
if (! base)
146-
base = (char *) str;
146+
base = str;
147147
else
148148
base++;
149149

@@ -164,9 +164,9 @@ get_module_name (const char *str)
164164
static char *
165165
get_module_path (const char *prefix, const char *str)
166166
{
167-
char *dir;
167+
const char *dir;
168168
char *base;
169-
char *ext;
169+
const char *ext;
170170
char *ret;
171171

172172
ext = strrchr (str, '.');

0 commit comments

Comments
 (0)