sysctl: remove index() for buildroot

The uClibc does not support index() function.

A patch from Buildroot.

Reference: http://git.buildroot.net/buildroot/patch/?id=f460603f02092b4f514d108dd8b4167a7a056213
Backported-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Steven J. Hill authored and Craig Small committed 2011-12-18 10:28:21 +11:00
1 parent 2019cbfded
commit dd03003edd
1 file changed
+2 -2
+2 -2
View File
@@ -297,7 +297,7 @@ static int WriteSetting(const char *setting) {
return 0;
} /* end if */
equals = index(setting, '=');
equals = strchr(setting, '=');
if (!equals) {
fprintf(stderr, ERR_NO_EQUALS, setting);
@@ -546,7 +546,7 @@ int main(int argc, char *argv[]) {
if (NameOnly && Quiet) // nonsense
return Usage(me);
SwitchesAllowed = false;
if (WriteMode || index(*argv, '='))
if (WriteMode || strchr(*argv, '='))
ReturnCode = WriteSetting(*argv);
else
ReturnCode = ReadSetting(*argv);