janitor: add DIV_ROUND_UP and use it.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Pierre Habouzit
2009-07-22 23:34:35 +02:00
committed by Junio C Hamano
parent f630cfda88
commit 98cb6f30f7
3 changed files with 4 additions and 2 deletions

2
help.c
View File

@ -100,7 +100,7 @@ static void pretty_print_string_list(struct cmdnames *cmds, int longest)
if (space < max_cols)
cols = max_cols / space;
rows = (cmds->cnt + cols - 1) / cols;
rows = DIV_ROUND_UP(cmds->cnt, cols);
for (i = 0; i < rows; i++) {
printf(" ");