pkt-line: provide a LARGE_PACKET_MAX static buffer
[gitweb.git] / builtin / fetch-pack.c
index f73664f433c9b602515fe28456da8c86ef0fe4b8..c21cc2c778ae35229f49cddfc55921c0ff7fb8b4 100644 (file)
@@ -100,12 +100,11 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
                        /* in stateless RPC mode we use pkt-line to read
                         * from stdin, until we get a flush packet
                         */
-                       static char line[1000];
                        for (;;) {
-                               int n = packet_read_line(0, line, sizeof(line));
-                               if (!n)
+                               char *line = packet_read_line(0, NULL);
+                               if (!line)
                                        break;
-                               string_list_append(&sought, xmemdupz(line, n));
+                               string_list_append(&sought, xstrdup(line));
                        }
                }
                else {