diff options
author | Volker Lendecke <vl@samba.org> | 2011-04-07 22:03:49 +0200 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-04-15 09:32:55 +0200 |
commit | 53f50c2268122e648a09e4b0643cd29fcc7a4bfd (patch) | |
tree | 524b6456189529dec6ca6f3a00bd8ccd33161bfa | |
parent | 9c2aa5b18d60237a8afb5537b91b8d3d45353fd4 (diff) | |
download | samba-53f50c2268122e648a09e4b0643cd29fcc7a4bfd.tar.gz samba-53f50c2268122e648a09e4b0643cd29fcc7a4bfd.tar.bz2 samba-53f50c2268122e648a09e4b0643cd29fcc7a4bfd.zip |
s3: Fix bug 8066, wrong output in smbget
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Apr 15 09:32:55 CEST 2011 on sn-devel-104
-rw-r--r-- | source3/utils/smbget.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c index 672e438376..fc65b3b570 100644 --- a/source3/utils/smbget.c +++ b/source3/utils/smbget.c @@ -76,10 +76,15 @@ static void change_columns(int sig) static void human_readable(off_t s, char *buffer, int l) { - if(s > 1024 * 1024 * 1024) snprintf(buffer, l, "%.2fGb", 1.0 * s / (1024 * 1024 * 1024)); - else if(s > 1024 * 1024) snprintf(buffer, l, "%.2fMb", 1.0 * s / (1024 * 1024)); - else if(s > 1024) snprintf(buffer, l, "%.2fkb", 1.0 * s / 1024); - else snprintf(buffer, l, OFF_T_FORMAT"b", (OFF_T_FORMAT_CAST)s); + if (s > 1024 * 1024 * 1024) { + snprintf(buffer, l, "%.2fGB", 1.0 * s / (1024 * 1024 * 1024)); + } else if (s > 1024 * 1024) { + snprintf(buffer, l, "%.2fMB", 1.0 * s / (1024 * 1024)); + } else if (s > 1024) { + snprintf(buffer, l, "%.2fkB", 1.0 * s / 1024); + } else { + snprintf(buffer, l, OFF_T_FORMAT"b", (OFF_T_FORMAT_CAST)s); + } } static void get_auth_data(const char *srv, const char *shr, char *wg, int wglen, char *un, int unlen, char *pw, int pwlen) |