bin: Prefer strrchr() to rindex().

This removes the last index/rindex usage from /bin.
This commit is contained in:
Jilles Tjoelker 2011-03-15 22:22:11 +00:00
parent 1f5cdd5a99
commit 0cf90cd1d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219680
3 changed files with 3 additions and 3 deletions

View File

@ -80,7 +80,7 @@ main(int argc, char *argv[])
* "link", for which the functionality provided is greatly
* simplified.
*/
if ((p = rindex(argv[0], '/')) == NULL)
if ((p = strrchr(argv[0], '/')) == NULL)
p = argv[0];
else
++p;

View File

@ -90,7 +90,7 @@ main(int argc, char *argv[])
* "unlink", for which the functionality provided is greatly
* simplified.
*/
if ((p = rindex(argv[0], '/')) == NULL)
if ((p = strrchr(argv[0], '/')) == NULL)
p = argv[0];
else
++p;

View File

@ -194,7 +194,7 @@ main(int argc, char **argv)
int res;
char *p;
if ((p = rindex(argv[0], '/')) == NULL)
if ((p = strrchr(argv[0], '/')) == NULL)
p = argv[0];
else
p++;