use strchr() not index()
This commit is contained in:
@ -236,7 +236,7 @@ int sort_main(int argc, char **argv)
|
|||||||
bb_default_error_retval = 2;
|
bb_default_error_retval = 2;
|
||||||
/* Parse command line options */
|
/* Parse command line options */
|
||||||
while((c=getopt(argc,argv,optlist))>0) {
|
while((c=getopt(argc,argv,optlist))>0) {
|
||||||
line=index(optlist,c);
|
line=strchr(optlist,c);
|
||||||
if(!line) bb_show_usage();
|
if(!line) bb_show_usage();
|
||||||
switch(*line) {
|
switch(*line) {
|
||||||
#ifdef CONFIG_FEATURE_SORT_BIG
|
#ifdef CONFIG_FEATURE_SORT_BIG
|
||||||
@ -267,7 +267,7 @@ int sort_main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
} /* no else needed: fall through to syntax error
|
} /* no else needed: fall through to syntax error
|
||||||
because comma isn't in optlist */
|
because comma isn't in optlist */
|
||||||
temp2=index(optlist,*temp);
|
temp2=strchr(optlist,*temp);
|
||||||
flag=(1<<(temp2-optlist));
|
flag=(1<<(temp2-optlist));
|
||||||
if(!temp2 || (flag>FLAG_M && flag<FLAG_b))
|
if(!temp2 || (flag>FLAG_M && flag<FLAG_b))
|
||||||
bb_error_msg_and_die("Unknown key option.");
|
bb_error_msg_and_die("Unknown key option.");
|
||||||
|
@ -43,7 +43,7 @@ static inline Bounds boundary(const char *buffer, const char *login)
|
|||||||
}
|
}
|
||||||
start++;
|
start++;
|
||||||
|
|
||||||
stop = index(start, '\n'); /* index is a BSD-ism */
|
stop = strchr(start, '\n');
|
||||||
b.start = start - buffer;
|
b.start = start - buffer;
|
||||||
b.stop = stop - buffer;
|
b.stop = stop - buffer;
|
||||||
return b;
|
return b;
|
||||||
|
@ -221,7 +221,7 @@ print_autowrap (WINDOW * win, const char *prompt, int width, int y, int x)
|
|||||||
newl = 1;
|
newl = 1;
|
||||||
word = tempstr;
|
word = tempstr;
|
||||||
while (word && *word) {
|
while (word && *word) {
|
||||||
sp = index(word, ' ');
|
sp = strchr(word, ' ');
|
||||||
if (sp)
|
if (sp)
|
||||||
*sp++ = 0;
|
*sp++ = 0;
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ print_autowrap (WINDOW * win, const char *prompt, int width, int y, int x)
|
|||||||
wlen = strlen(word);
|
wlen = strlen(word);
|
||||||
if (wlen > room ||
|
if (wlen > room ||
|
||||||
(newl && wlen < 4 && sp && wlen+1+strlen(sp) > room
|
(newl && wlen < 4 && sp && wlen+1+strlen(sp) > room
|
||||||
&& (!(sp2 = index(sp, ' ')) || wlen+1+(sp2-sp) > room))) {
|
&& (!(sp2 = strchr(sp, ' ')) || wlen+1+(sp2-sp) > room))) {
|
||||||
cur_y++;
|
cur_y++;
|
||||||
cur_x = x;
|
cur_x = x;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user