use DIV_ROUND_UP
[gitweb.git] / imap-send.c
index 857591660f485d65dec3390b22dd2083c94d7a44..37388f142d035f51284ed30eacac792177713697 100644 (file)
@@ -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;