builtin-apply: remove unused increment
authorJunio C Hamano <junkio@cox.net>
Thu, 10 Aug 2006 07:56:40 +0000 (00:56 -0700)
committerJunio 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

index c15987386b0818b770f40ea92dbded6b25ff394e..be2c7152cd7ee8c8076cd4bbd5660dd2f85b0fd1 100644 (file)
@@ -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;