summaryrefslogtreecommitdiffstats
path: root/libmount/src
diff options
context:
space:
mode:
authorSami Kerola2012-10-12 21:23:54 +0200
committerKarel Zak2012-10-22 10:13:32 +0200
commit913e43b8e2dedbac69880e26fc1eead509fb666e (patch)
tree641afdbe6475341ec2e73781b48b48898ef752e0 /libmount/src
parentfsck.cramfs: compile with -DINCLUDE_FS_TESTS for make check (diff)
downloadkernel-qcow2-util-linux-913e43b8e2dedbac69880e26fc1eead509fb666e.tar.gz
kernel-qcow2-util-linux-913e43b8e2dedbac69880e26fc1eead509fb666e.tar.xz
kernel-qcow2-util-linux-913e43b8e2dedbac69880e26fc1eead509fb666e.zip
libmount, eject: replace index() and rindex() with strrch() or strrchr()
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>
Diffstat (limited to 'libmount/src')
-rw-r--r--libmount/src/tab_parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
index 463c884e3..2cae750dc 100644
--- a/libmount/src/tab_parse.c
+++ b/libmount/src/tab_parse.c
@@ -362,14 +362,14 @@ next_line:
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",