Skip to content

Commit be27fb7

Browse files
peffgitster
authored andcommitted
mktree: drop unused length parameter
The mktree_line() function does not actually look at the "len" parameter it is passed, and assumes the buffer it receives is NUL-terminated. Since the caller always passes a strbuf, this will be true. Let's drop the useless parameter. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 13a1781 commit be27fb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/mktree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static const char *mktree_usage[] = {
6767
NULL
6868
};
6969

70-
static void mktree_line(char *buf, size_t len, int nul_term_line, int allow_missing)
70+
static void mktree_line(char *buf, int nul_term_line, int allow_missing)
7171
{
7272
char *ptr, *ntr;
7373
const char *p;
@@ -172,7 +172,7 @@ int cmd_mktree(int ac, const char **av, const char *prefix)
172172
break;
173173
die("input format error: (blank line only valid in batch mode)");
174174
}
175-
mktree_line(sb.buf, sb.len, nul_term_line, allow_missing);
175+
mktree_line(sb.buf, nul_term_line, allow_missing);
176176
}
177177
if (is_batch_mode && got_eof && used < 1) {
178178
/*

0 commit comments

Comments
 (0)