transport.c: help gcc 4.6.3 users by squelching compiler warning
To a human reader, it is quite obvious that cmp is assigned before it is used, but gcc 4.6.3 that ships with Ubuntu 12.04 is among those that do not get this right. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Mar 25, 2013 at 12:51 UTC
04fe1184fd0611bf26785b365dd344b8f7d72861
1 file changed
+2
-1
transport.c
+2
-1
@@ -106,7 +106,8 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
106
return;
107
108
for (;;) {
109
- int cmp, len;
109
+ int cmp = 0; /* assigned before used */
110
+ int len;
111
112
if (!fgets(buffer, sizeof(buffer), f)) {
113
fclose(f);