Both index() and rindex() are legacy functions which may be withdrawn in
a future.
Reference: http://pubs.opengroup.org/onlinepubs/
009695399/functions/index.html
Reference: http://pubs.opengroup.org/onlinepubs/
009695399/functions/rindex.html
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
if (fgets(buf, sizeof(buf), f) == NULL)
return -EINVAL;
++*nlines;
- s = index (buf, '\n');
+ s = strchr (buf, '\n');
if (!s) {
/* Missing final newline? Otherwise extremely */
/* long line - assume file was corrupted */
if (feof(f)) {
DBG(TAB, mnt_debug_h(tb,
"%s: no final newline", filename));
- s = index (buf, '\0');
+ s = strchr (buf, '\0');
} else {
DBG(TAB, mnt_debug_h(tb,
"%s:%d: missing newline at line",
if (!f)
err(EXIT_FAILURE, _("cannot open %s"), _PATH_PROC_CDROMINFO);
- name = rindex(devname, '/') + 1;
+ name = strrchr(devname, '/') + 1;
while (name && !feof(f)) {
char line[512];