dovecot-2.2: quota: When reporting quota value/limit in kilobyte...

dovecot at dovecot.org dovecot at dovecot.org
Fri Mar 27 12:32:05 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/c34724e1c08b
changeset: 18388:c34724e1c08b
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Mar 27 14:31:01 2015 +0200
description:
quota: When reporting quota value/limit in kilobytes, round the value upwards.
Most importantly this doesn't truncate <1024 values to 0, which also in
quota limit means unlimited.

diffstat:

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

diffs (14 lines):

diff -r 0540c2834f68 -r c34724e1c08b src/plugins/quota/quota.c
--- a/src/plugins/quota/quota.c	Fri Mar 27 11:02:18 2015 +0200
+++ b/src/plugins/quota/quota.c	Fri Mar 27 14:31:01 2015 +0200
@@ -674,8 +674,8 @@
 		*limit_r = 0;
 
 	if (kilobytes) {
-		*value_r /= 1024;
-		*limit_r /= 1024;
+		*value_r = (*value_r + 1023) / 1024;
+		*limit_r = (*limit_r + 1023) / 1024;
 	}
 	return *limit_r == 0 ? 0 : 1;
 }


More information about the dovecot-cvs mailing list