From 53f50c2268122e648a09e4b0643cd29fcc7a4bfd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 7 Apr 2011 22:03:49 +0200 Subject: s3: Fix bug 8066, wrong output in smbget Autobuild-User: Volker Lendecke Autobuild-Date: Fri Apr 15 09:32:55 CEST 2011 on sn-devel-104 --- source3/utils/smbget.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source3/utils') 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) -- cgit