According to glibc documentation[1], "index is another name for strchr;
they are exactly the same. New code should always use strchr." The use
of index() breaks compilation for Android targets, which use Bionic
instead of glibc and don't have index().
[1] https://www.gnu.org/software/libc/manual/html_node/Search-Functions.html#index-index
strncpy(range, t, 16);
range[15] = '\0';
valstr = t;
- if ((s = index(range, '-')) != NULL) {
+ if ((s = strchr(range, '-')) != NULL) {
/* Possible range of values */
*s = '\0';
if (parse_valstr(range, max_val, &val_low) || (val_low < 0))
strncpy(range, t, 16);
range[15] = '\0';
valstr = t;
- if ((s = index(range, '-')) != NULL) {
+ if ((s = strchr(range, '-')) != NULL) {
/* Possible range of values */
*s = '\0';
if (parse_valstr(range, max_val, &val_low) || (val_low < 0))