From 42c78a216e751cfa2720c8276c9e9f2b81640e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 8 Jul 2017 12:35:35 +0200 Subject: 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 Reviewed-by: Jeff King Signed-off-by: Junio C Hamano --- imap-send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'imap-send.c') diff --git a/imap-send.c b/imap-send.c index 857591660f..37388f142d 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; -- cgit v1.2.3