]> granicus.if.org Git - procps-ng/commitdiff
sysctl.c: use strchr() instead of index()
authorYann E. MORIN <yann.morin.1998@free.fr>
Sun, 7 Aug 2016 09:31:25 +0000 (11:31 +0200)
committerCraig Small <csmall@enc.com.au>
Mon, 15 Aug 2016 11:14:23 +0000 (21:14 +1000)
index() is a legacy function, which is no longer implemented by all C
libraries (example: uClibc). Instead, use the POSIX defined strchr()
function.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
sysctl.c

index 3ec226f8cbbfa294fb042aa576a5dad997b21b66..ccabc332679a46793e9c0dd6516c36ada93129a4 100644 (file)
--- a/sysctl.c
+++ b/sysctl.c
@@ -814,7 +814,7 @@ int main(int argc, char *argv[])
                      program_invocation_short_name);
 
        for ( ; *argv; argv++) {
-               if (WriteMode || index(*argv, '='))
+               if (WriteMode || strchr(*argv, '='))
                        ReturnCode += WriteSetting(*argv);
                else
                        ReturnCode += ReadSetting(*argv);