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 2006-12-05 02:16:03 +00:00 committed by Craig Small
parent 2019cbfded
commit dd03003edd

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);