diff options
-rw-r--r-- | ls.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -125,6 +125,8 @@ static struct directory dirlist[ARG_MAX]; int nftw_ls(const char *p, const struct stat *sb, int flag, struct FTW *f) { + (void)sb; + if (flag == FTW_D) { strcat(dirlist[totaldirs].path, p); // FIXME: this is showing the wrong names @@ -235,7 +237,7 @@ static int ls_other(struct ls_entry *current, int cpos) putchar('\n'); } else if (display == COMMA) { - if (cpos + strlen(current->name) + 2 > columns) { + if (cpos + strlen(current->name) + 2 > (unsigned)columns) { putchar('\n'); cpos = 0; } @@ -261,8 +263,8 @@ static int ls_other(struct ls_entry *current, int cpos) static int ls_columns(struct ls_entry *current, int cpos) { - int cols = columns / (longestname + 1); - int row = 0; + //int cols = columns / (longestname + 1); + //int row = 0; // FIXME: this isn't right at all return ls_other(current, cpos); @@ -331,7 +333,7 @@ static int ls_add(const char *path, int do_stat) else working->time = st.st_mtime; - if (working->size > biggest) + if (working->size > (uintmax_t)biggest) biggest = working->size; if (working->links > maxlinks) maxlinks = working->links; @@ -341,9 +343,9 @@ static int ls_add(const char *path, int do_stat) struct group gr = *getgrgid(working->gid); strcpy(working->owner, pw.pw_name); strcpy(working->group, gr.gr_name); - if (strlen(working->owner) > longestowner) + if (strlen(working->owner) > (size_t)longestowner) longestowner = strlen(working->owner); - if (strlen(working->group) > longestgroup) + if (strlen(working->group) > (size_t)longestgroup) longestgroup = strlen(working->group); } else { int l, n = 0; @@ -403,7 +405,7 @@ static int ls_add(const char *path, int do_stat) strcpy(working->name, dname); - if (strlen(dname) > longestname) { + if (strlen(dname) > (size_t)longestname) { longestname = strlen(dname); } |