bin: Prefer strrchr() to rindex().
This removes the last index/rindex usage from /bin.
This commit is contained in:
parent
8060d27e7b
commit
2a22eeb6a2
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user