bin: Prefer strrchr() to rindex().

This removes the last index/rindex usage from /bin.
This commit is contained in:
jilles 2011-03-15 22:22:11 +00:00
parent 8060d27e7b
commit 2a22eeb6a2
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++;