prio-queue: priority queue of pointers to structs
[gitweb.git] / transport.c
index 384ff9acf1e1c6e192f1f3f75d5fb20c431053ce..e6f9346c762416b9c0e97f9023062f99e4542dbc 100644 (file)
@@ -106,7 +106,8 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
                return;
 
        for (;;) {
-               int cmp = cmp, len;
+               int cmp = 0; /* assigned before used */
+               int len;
 
                if (!fgets(buffer, sizeof(buffer), f)) {
                        fclose(f);
@@ -752,7 +753,7 @@ void transport_print_push_status(const char *dest, struct ref *refs,
                    ref->status != REF_STATUS_OK)
                        n += print_one_push_status(ref, dest, n, porcelain);
                if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD) {
-                       if (!strcmp(head, ref->name))
+                       if (head != NULL && !strcmp(head, ref->name))
                                *reject_reasons |= REJECT_NON_FF_HEAD;
                        else
                                *reject_reasons |= REJECT_NON_FF_OTHER;