sim: replace rindex with strrchr

This commit is contained in:
Mike Frysinger
2021-01-09 04:12:35 -05:00
parent 7eb99e5e27
commit a9fd212a24
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2021-01-09 Mike Frysinger <vapier@gentoo.org>
* readlink4.c (main): Change rindex to strrchr.
2021-01-07 Mike Frysinger <vapier@gentoo.org>
PR ld/13900

View File

@ -39,10 +39,10 @@ int main (int argc, char *argv[])
strcat (buf, argv[0]);
if (rindex (buf, '/') == NULL)
if (strrchr (buf, '/') == NULL)
strcat (buf, "./");
for (i = rindex (buf, '/') - buf + 1; i < max; i++)
for (i = strrchr (buf, '/') - buf + 1; i < max; i++)
buf[i] = 'a';
buf [i] = 0;