From e5e6b75a81a556e976a8a27cd7063b1f5d098aa2 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 10 Nov 2015 11:33:37 +0100 Subject: [PATCH] these must be const! --- src/ui_functions.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui_functions.c b/src/ui_functions.c index 9eb5a53..60d7092 100644 --- a/src/ui_functions.c +++ b/src/ui_functions.c @@ -409,12 +409,13 @@ static void helper_print(void) { static void show_stat(int init, int end, int win) { int j, i; int check = strlen(mywin[win].tot_size); - int perm_bit[9] = {S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH}; - char perm_sign[3] = {'r', 'w', 'x'}, str[20]; + const int perm_bit[9] = {S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH}; + const char perm_sign[3] = {'r', 'w', 'x'}; + char str[20]; float total_size = 0; struct stat file_stat; - check %= check - 1; // "check" should be 0 or 1 (strlen(tot_size) will always be > 1, so i can safely divide for check - 1 + check %= check - 1; // "check" should be 0 or 1 (strlen(tot_size) will never be 1, so i can safely divide for check - 1) for (i = check * init; i < ps[win].number_of_files; i++) { stat(ps[win].nl[i], &file_stat); if (!check) {