Coding style cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
38e5a4a54f
commit
6a8b1c4f84
1 changed files with 8 additions and 5 deletions
|
@ -746,8 +746,9 @@ static int multiselect_parse(char *array, int count, char *response)
|
||||||
char *ends = NULL;
|
char *ends = NULL;
|
||||||
char *starts = strtok_r(str, " ", &saveptr);
|
char *starts = strtok_r(str, " ", &saveptr);
|
||||||
|
|
||||||
if (starts == NULL)
|
if (starts == NULL) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
strtrim(starts);
|
strtrim(starts);
|
||||||
int len = strlen(starts);
|
int len = strlen(starts);
|
||||||
if(len == 0)
|
if(len == 0)
|
||||||
|
@ -765,9 +766,9 @@ static int multiselect_parse(char *array, int count, char *response)
|
||||||
if(len > 1) {
|
if(len > 1) {
|
||||||
/* check for range */
|
/* check for range */
|
||||||
char *p;
|
char *p;
|
||||||
if((p = strchr(starts+1, '-'))) {
|
if((p = strchr(starts + 1, '-'))) {
|
||||||
*p = 0;
|
*p = 0;
|
||||||
ends = p+1;
|
ends = p + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -777,9 +778,11 @@ static int multiselect_parse(char *array, int count, char *response)
|
||||||
if(!ends) {
|
if(!ends) {
|
||||||
array[start-1] = include;
|
array[start-1] = include;
|
||||||
} else {
|
} else {
|
||||||
if(parseindex(ends, &end, start, count) != 0)
|
int d;
|
||||||
|
if(parseindex(ends, &end, start, count) != 0) {
|
||||||
return(-1);
|
return(-1);
|
||||||
for(int d = start; d <= end; d++) {
|
}
|
||||||
|
for(d = start; d <= end; d++) {
|
||||||
array[d-1] = include;
|
array[d-1] = include;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue