|author||Ed Schouten <ed@FreeBSD.org>||2012-01-03 18:51:58 +0000|
|committer||Ed Schouten <ed@FreeBSD.org>||2012-01-03 18:51:58 +0000|
Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls.
Notes: svn path=/head/; revision=229403
Diffstat (limited to 'sbin/shutdown')
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c
index 7bd93a0c0881..6e662a8b6f44 100644
@@ -123,7 +123,7 @@ main(int argc, char **argv)
* Test for the special case where the utility is called as
* "poweroff", for which it runs 'shutdown -p now'.
- if ((p = rindex(argv, '/')) == NULL)
+ if ((p = strrchr(argv, '/')) == NULL)
p = argv;