aboutsummaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/output.c b/src/output.c
index 9dd274b..be0afb1 100644
--- a/src/output.c
+++ b/src/output.c
@@ -63,7 +63,7 @@ void print_list(struct list_head *list) {
ptr = lh->first;
while (ptr != NULL) {
- printf(" %8lu %2s ", ((ptr->fsize>=1024) ? (ptr->fsize/1024) : ptr->fsize),
+ printf(" %8ld %2s ", ((ptr->fsize>=1024) ? (ptr->fsize/1024) : ptr->fsize),
((ptr->fsize >= 1024) ? "kB" : ""));
tm = localtime(&ptr->ftime);
@@ -75,7 +75,9 @@ void print_list(struct list_head *list) {
printf(" %8s ", timestamp);
}
printf(" %s\n", ptr->fname);
- total_size += ptr->fsize;
+ /* Linux: Neither man stat(2) nor stat(3type) declare when struct stat field st_size
+ * get's a negative value. */
+ total_size += (ptr->fsize>0) ? (unsigned long int)ptr->fsize : 0;
ptr = ptr->next;
}
fputc_all_cols('=', stdout);