dovecot-2.0: doveadm quota get: Report quota percentage more acc...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 16 18:49:59 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/dec8986d33ea
changeset: 11554:dec8986d33ea
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 16 16:49:56 2010 +0100
description:
doveadm quota get: Report quota percentage more accurately.
The *100 can't overflow quota, since quota is reported in kilobytes.

diffstat:

 src/plugins/quota/doveadm-quota.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (14 lines):

diff -r 7a7bfdd708ff -r dec8986d33ea src/plugins/quota/doveadm-quota.c
--- a/src/plugins/quota/doveadm-quota.c	Wed Jun 16 16:17:52 2010 +0100
+++ b/src/plugins/quota/doveadm-quota.c	Wed Jun 16 16:49:56 2010 +0100
@@ -26,8 +26,8 @@
 		if (ret > 0) {
 			doveadm_print_num(value);
 			doveadm_print_num(limit);
-			if (limit >= 100)
-				doveadm_print_num(value / (limit/100));
+			if (limit > 0)
+				doveadm_print_num(value*100 / limit);
 			else
 				doveadm_print("0");
 		} else if (ret == 0) {


More information about the dovecot-cvs mailing list