Fix warning 'array subscript of type char'

This commit is contained in:
sin
2014-09-02 12:45:39 +01:00
parent 0cbafaecb6
commit b712ef44ad
3 changed files with 8 additions and 6 deletions

10
fold.c
View File

@@ -75,21 +75,23 @@ foldline(const char *str, long width)
bool space;
long col, j;
size_t i = 0, n = 0;
int c;
do {
space = false;
for(j = i, col = 0; str[j] && col <= width; j++) {
if(!UTF8_POINT(str[j]) && !bflag)
c = str[j];
if(!UTF8_POINT(c) && !bflag)
continue;
if(sflag && isspace(str[j])) {
if(sflag && isspace(c)) {
space = true;
n = j+1;
}
else if(!space)
n = j;
if(!bflag && iscntrl(str[j]))
switch(str[j]) {
if(!bflag && iscntrl(c))
switch(c) {
case '\b':
col--;
break;