diff options
author | René Scharfe <l.s.r@web.de> | 2017-07-08 10:35:35 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-10 21:24:36 (GMT) |
commit | 42c78a216e751cfa2720c8276c9e9f2b81640e6b (patch) | |
tree | ff12c046af74e524d80ec247f8039592337afee6 /imap-send.c | |
parent | 8c8e978f5719c6a58fb998742207bf907f963143 (diff) | |
download | git-42c78a216e751cfa2720c8276c9e9f2b81640e6b.zip git-42c78a216e751cfa2720c8276c9e9f2b81640e6b.tar.gz git-42c78a216e751cfa2720c8276c9e9f2b81640e6b.tar.bz2 |
use DIV_ROUND_UP
Convert code that divides and rounds up to use DIV_ROUND_UP to make the
intent clearer and reduce the number of magic constants.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'imap-send.c')
-rw-r--r-- | imap-send.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/imap-send.c b/imap-send.c index 8575916..37388f1 100644 --- a/imap-send.c +++ b/imap-send.c @@ -861,7 +861,7 @@ static char hexchar(unsigned int b) return b < 10 ? '0' + b : 'a' + (b - 10); } -#define ENCODED_SIZE(n) (4*((n+2)/3)) +#define ENCODED_SIZE(n) (4 * DIV_ROUND_UP((n), 3)) static char *cram(const char *challenge_64, const char *user, const char *pass) { int i, resp_len, encoded_len, decoded_len; |