diff --git a/src/poc/sgr-direct.c b/src/poc/sgr-direct.c index 3067757c8..bcec366b2 100644 --- a/src/poc/sgr-direct.c +++ b/src/poc/sgr-direct.c @@ -4,8 +4,7 @@ #include #include -int main(int argc, char** argv){ - (void)argc; +int main(void){ if(!setlocale(LC_ALL, "")){ return EXIT_FAILURE; } diff --git a/src/poc/sgr.c b/src/poc/sgr.c index 34d1ae60d..e6cf1cfc6 100644 --- a/src/poc/sgr.c +++ b/src/poc/sgr.c @@ -44,8 +44,8 @@ int main(int argc, char** argv){ fprintf(stderr, "Couldn't get terminfo entry for sgr\n"); return EXIT_FAILURE; } - int sgrs[8] = { 0 }; - int pivot = sizeof(sgrs) / sizeof(*sgrs); + int sgrs[9] = { 0 }; + int pivot = 8; if(DISABLE_ALTCHARSET){ --pivot; } @@ -53,21 +53,22 @@ int main(int argc, char** argv){ // generate all values int cols = 0; while(pivot >= 0){ - for(size_t i = 0 ; i < sizeof(sgrs) / sizeof(*sgrs) ; ++i){ + int i; + for(i = 0 ; i < 9 ; ++i){ cols += printf("%c", sgrs[i] ? '1' : '0'); } cols += printf(" (%02d)", pivot); - int r = putp(tiparm(sgr, sgrs[0], sgrs[1], sgrs[2], sgrs[3], sgrs[4], + i = putp(tiparm(sgr, sgrs[0], sgrs[1], sgrs[2], sgrs[3], sgrs[4], sgrs[5], sgrs[6], sgrs[7], sgrs[8])); - if(r != OK){ + if(i != OK){ return EXIT_FAILURE; } - if((r = printf(" %s ", argv[0])) < 0){ + if((i = printf(" %s ", argv[0])) < 0){ return EXIT_FAILURE; } - cols += r; - r = putp(tiparm(sgr, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - if(r != OK){ + cols += i; + i = putp(tiparm(sgr, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + if(i != OK){ return EXIT_FAILURE; } pivot = pivot_on(pivot, sgrs, sgrcount);