Fix use of uninitialized afhi->header_len.
[paraslash.git] / chunk_queue.c
index d87cd18b4fba100e33322339dc79f00bdbb0470a..84f4a4a88ebfcb5acb4b0cfaf9dc861b87f82947 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007-2008 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -62,7 +62,7 @@ int cq_enqueue(struct chunk_queue *cq, long unsigned chunk_num,
                if (ret < 0)
                        return ret;
        } else
-               buf = vss_get_header(&len);
+               vss_get_header(&buf, &len);
        if (cq->num_pending + len > cq->max_pending)
                return -E_QUEUE;
        qc = para_malloc(sizeof(struct queued_chunk));
@@ -133,7 +133,7 @@ int cq_get(struct queued_chunk *qc, char **buf, size_t *len)
                if (ret < 0)
                        return ret;
        } else
-               *buf = vss_get_header(len);
+               vss_get_header(buf, len);
        assert(*len > qc->sent);
        *buf += qc->sent;
        *len -= qc->sent;