# HG changeset patch # User Timo Sirainen # Date 1301948311 -10800 # Node ID 618f610c7c67ac317e800593410637ae98fbd6c2 # Parent 8fa5445204133d81025f5ac1b54faa2244afe5ec quota: Fixed checking message count limit when saving multiple mails in transaction. diff -r 8fa544520413 -r 618f610c7c67 src/plugins/quota/quota.c --- a/src/plugins/quota/quota.c Mon Apr 04 23:07:37 2011 +0300 +++ b/src/plugins/quota/quota.c Mon Apr 04 23:18:31 2011 +0300 @@ -1170,7 +1170,8 @@ *too_large_r = FALSE; - if (ctx->count_left != 0 && ctx->bytes_left >= ctx->bytes_used + size) + if ((int64_t)ctx->count_left >= ctx->count_used + 1 && + (int64_t)ctx->bytes_left >= ctx->bytes_used + (off_t)size) return 1; roots = array_get(&ctx->quota->roots, &count);