提交 242abf10 编写于 作者: J Junio C Hamano

builtin-apply: remove unused increment

We do not use desc.alloc after assigning desc.buffer to patch->result;
do not bother to increment it.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 306ea2df
......@@ -1700,10 +1700,8 @@ static int apply_data(struct patch *patch, struct stat *st, struct cache_entry *
return -1;
/* NUL terminate the result */
if (desc.alloc <= desc.size) {
if (desc.alloc <= desc.size)
desc.buffer = xrealloc(desc.buffer, desc.size + 1);
desc.alloc++;
}
desc.buffer[desc.size] = 0;
patch->result = desc.buffer;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册