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>
This commit is contained in:
committed by
Junio C Hamano
parent
8c8e978f57
commit
42c78a216e
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user