commit b712ef44ad49c5eed7fb89e1ab4b85a114ab4c6d
Author: sin <[email protected]>
Date:   Tue Sep 2 12:45:39 2014 +0100

    Fix warning 'array subscript of type char'

diff --git a/fold.c b/fold.c
index c307bb9..9f6d66a 100644
--- a/fold.c
+++ b/fold.c
@@ -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 '':
                                        col--;
                                        break;
diff --git a/sort.c b/sort.c
index b0b9131..e97673b 100644
--- a/sort.c
+++ b/sort.c
@@ -172,7 +172,7 @@ linecmp(const char **a, const char **b)
 static int
 parse_flags(char **s, int *flags, int bflag)
 {
-       while(isalpha(**s))
+       while(isalpha((int)**s))
                switch(*((*s)++)) {
                case 'b':
                        *flags |= bflag;
diff --git a/split.c b/split.c
index 638af54..4b2c2d8 100644
--- a/split.c
+++ b/split.c
@@ -41,7 +41,7 @@ main(int argc, char *argv[])
                size = strtoull(tmp, &end, 10);
                if(*end == '

Reply via email to