Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin-apply: remove unused increment
author
Junio C Hamano
<junkio@cox.net>
Thu, 10 Aug 2006 07:56:40 +0000
(
00:56
-0700)
committer
Junio C Hamano
<junkio@cox.net>
Thu, 10 Aug 2006 07:56:40 +0000
(
00:56
-0700)
We do not use desc.alloc after assigning desc.buffer to patch->result;
do not bother to increment it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-apply.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
306ea2d
)
diff --git
a/builtin-apply.c
b/builtin-apply.c
index c15987386b0818b770f40ea92dbded6b25ff394e..be2c7152cd7ee8c8076cd4bbd5660dd2f85b0fd1 100644
(file)
--- a/
builtin-apply.c
+++ b/
builtin-apply.c
@@
-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;