fix pack-object buffer size
authorNicolas Pitre <nico@cam.org>
Thu, 20 Apr 2006 21:25:37 +0000 (17:25 -0400)
committerJunio C Hamano <junkio@cox.net>
Fri, 21 Apr 2006 07:45:10 +0000 (00:45 -0700)
The input line has 40 _chars_ of sha1 and no 20 _bytes_. It should also
account for the space before the pathname, and the terminating \n and \0.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
pack-objects.c

index f7d6217..c0acc46 100644 (file)
@@ -1231,7 +1231,7 @@ static void setup_progress_signal(void)
 int main(int argc, char **argv)
 {
        SHA_CTX ctx;
-       char line[PATH_MAX + 20];
+       char line[40 + 1 + PATH_MAX + 2];
        int window = 10, depth = 10, pack_to_stdout = 0;
        struct object_entry **list;
        int num_preferred_base = 0;