From: Mike Frysinger Date: Sat, 9 Jan 2021 09:12:35 +0000 (-0500) Subject: sim: replace rindex with strrchr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a9fd212a2416406f8503efe9e449718d0becfcb2;p=binutils-gdb.git sim: replace rindex with strrchr --- diff --git a/sim/testsuite/sim/cris/ChangeLog b/sim/testsuite/sim/cris/ChangeLog index e9444bd18d8..9cfffd1d869 100644 --- a/sim/testsuite/sim/cris/ChangeLog +++ b/sim/testsuite/sim/cris/ChangeLog @@ -1,3 +1,7 @@ +2021-01-09 Mike Frysinger + + * readlink4.c (main): Change rindex to strrchr. + 2021-01-07 Mike Frysinger PR ld/13900 diff --git a/sim/testsuite/sim/cris/c/readlink4.c b/sim/testsuite/sim/cris/c/readlink4.c index 07a01e66453..028f3ee44ca 100644 --- a/sim/testsuite/sim/cris/c/readlink4.c +++ b/sim/testsuite/sim/cris/c/readlink4.c @@ -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;