[PATCH] sim: replace rindex with strrchr

Andrew Burgess andrew.burgess@embecosm.com
Sat Jan 9 11:35:02 GMT 2021


LGTM, but will need a ChangeLog entry.  Ideally the ChangeLog entries
would be included in your patch email - just gives a chance for them
to be checked for missing entries / typos / etc.

Thanks,
Andrew


* Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> [2021-01-09 04:15:13 -0500]:

> ---
>  sim/testsuite/sim/cris/c/readlink4.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sim/testsuite/sim/cris/c/readlink4.c b/sim/testsuite/sim/cris/c/readlink4.c
> index 07a01e66453e..028f3ee44ca6 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.28.0
> 


More information about the Gdb-patches mailing list