cast nlink_t to unsigned int - to work correctly on 64 bit arch

This commit is contained in:
Radim Kolar 2014-09-08 18:31:18 +02:00
parent 1b556bda7a
commit 6cdb983bf4
2 changed files with 2 additions and 2 deletions

View File

@ -374,7 +374,7 @@ static void printlong_ffind (char * name, struct stat * sb)
printf("%4ld ", (long)BLK(sb->st_size));
modep = ((S_IFDIR & sb->st_mode)) ? "drwxrwxrwx" : "-rw-rw-rw-" ;
printf("%s %3u %-*s %-*s ", modep, sb->st_nlink, 8, "nobody", 8, "nobody");
printf("%s %3u %-*s %-*s ", modep, (unsigned int)sb->st_nlink, 8, "nobody", 8, "nobody");
printf("%8ld ", (long)sb->st_size);
printtime_ffind(sb->st_mtime);

View File

@ -126,7 +126,7 @@ void printlong (LS * stats, int num)
if (f_size ) printf("%4lu ", (unsigned long)BLK(stats->lstat.st_size));
modep = ((S_IFDIR & stats->lstat.st_mode)) ? "drwxrwxrwx" : "-rw-rw-rw-" ;
(void)printf("%s %3u %-*s ", modep, stats->lstat.st_nlink, 8, "nobody");
(void)printf("%s %3u %-*s ", modep, (unsigned int)stats->lstat.st_nlink, 8, "nobody");
if (f_group) printf("%-*s ", 8, "nobody");
else printf("%8lu ", (unsigned long)stats->lstat.st_size);
if (f_accesstime) printtime(stats->lstat.st_atime);