From a9fd212a2416406f8503efe9e449718d0becfcb2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 9 Jan 2021 04:12:35 -0500 Subject: [PATCH] sim: replace rindex with strrchr --- sim/testsuite/sim/cris/ChangeLog | 4 ++++ sim/testsuite/sim/cris/c/readlink4.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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; -- 2.30.2