Use big_num() in a few more places.
authorWayne Davison <wayned@samba.org>
Fri, 18 Jul 2008 00:01:10 +0000 (17:01 -0700)
committerWayne Davison <wayned@samba.org>
Fri, 18 Jul 2008 00:01:10 +0000 (17:01 -0700)
generator.c
log.c
tls.c

index 2fc23d1..a0a95d9 100644 (file)
@@ -1198,7 +1198,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
 static void list_file_entry(struct file_struct *f)
 {
        char permbuf[PERMSTRING_SIZE];
-       double len;
+       int64 len;
 
        if (!F_IS_ACTIVE(f)) {
                /* this can happen if duplicate names were removed */
@@ -1212,14 +1212,14 @@ static void list_file_entry(struct file_struct *f)
 
 #ifdef SUPPORT_LINKS
        if (preserve_links && S_ISLNK(f->mode)) {
-               rprintf(FINFO, "%s %11.0f %s %s -> %s\n",
-                       permbuf, len, timestring(f->modtime),
+               rprintf(FINFO, "%s %11s %s %s -> %s\n",
+                       permbuf, big_num(len, 0), timestring(f->modtime),
                        f_name(f, NULL), F_SYMLINK(f));
        } else
 #endif
        {
-               rprintf(FINFO, "%s %11.0f %s %s\n",
-                       permbuf, len, timestring(f->modtime),
+               rprintf(FINFO, "%s %11s %s %s\n",
+                       permbuf, big_num(len, 0), timestring(f->modtime),
                        f_name(f, NULL));
        }
 }
diff --git a/log.c b/log.c
index 2d828c1..4db9663 100644 (file)
--- a/log.c
+++ b/log.c
@@ -499,9 +499,9 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
                                n = client_addr(0);
                        break;
                case 'l':
-                       strlcat(fmt, ".0f", sizeof fmt);
+                       strlcat(fmt, "s", sizeof fmt);
                        snprintf(buf2, sizeof buf2, fmt,
-                                (double)F_LENGTH(file));
+                                big_num(F_LENGTH(file), 0));
                        n = buf2;
                        break;
                case 'U':
@@ -617,8 +617,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
                                b = stats.total_read -
                                        initial_stats->total_read;
                        }
-                       strlcat(fmt, ".0f", sizeof fmt);
-                       snprintf(buf2, sizeof buf2, fmt, (double)b);
+                       strlcat(fmt, "s", sizeof fmt);
+                       snprintf(buf2, sizeof buf2, fmt, big_num(b, 0));
                        n = buf2;
                        break;
                case 'c':
@@ -629,8 +629,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
                                b = stats.total_read -
                                        initial_stats->total_read;
                        }
-                       strlcat(fmt, ".0f", sizeof fmt);
-                       snprintf(buf2, sizeof buf2, fmt, (double)b);
+                       strlcat(fmt, "s", sizeof fmt);
+                       snprintf(buf2, sizeof buf2, fmt, big_num(b, 0));
                        n = buf2;
                        break;
                case 'i':
diff --git a/tls.c b/tls.c
index c11bdb4..c01bdc8 100644 (file)
--- a/tls.c
+++ b/tls.c
@@ -179,8 +179,8 @@ static void list_file(const char *fname)
                printf("%5ld,%6ld",
                    (long)major(buf.st_rdev),
                    (long)minor(buf.st_rdev));
-       } else /* NB: use double for size since it might not fit in a long. */
-               printf("%12.0f", (double)buf.st_size);
+       } else
+               printf("%12s", big_num(buf.st_size, 0));
        printf(" %6ld.%-6ld %6ld %s %s%s\n",
               (long)buf.st_uid, (long)buf.st_gid, (long)buf.st_nlink,
               datebuf, fname, linkbuf);