Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5492:571c43d9080c HEAD
Recalculate quota if it's negative.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 03 Apr 2007 07:44:34 +0300 |
parents | 22f0e7b297d6 |
children | 9f7f311260be |
files | src/plugins/quota/quota-dict.c |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/quota/quota-dict.c Tue Apr 03 06:36:44 2007 +0300 +++ b/src/plugins/quota/quota-dict.c Tue Apr 03 07:44:34 2007 +0300 @@ -116,14 +116,15 @@ DICT_QUOTA_CURRENT_COUNT_PATH, &value); if (ret < 0) *value_r = 0; - else if (ret == 0) - ret = dict_quota_count(root, want_bytes, value_r); else { long long tmp; - /* don't break in case the quota value is negative. */ - tmp = strtoll(value, NULL, 10); - *value_r = tmp < 0 ? 0 : tmp; + /* recalculate quota if it's negative */ + tmp = ret == 0 ? -1 : strtoll(value, NULL, 10); + if (tmp < 0) + ret = dict_quota_count(root, want_bytes, value_r); + else + *value_r = tmp; } t_pop();