From 479871169b34db769750fbdc521cca64b1320cdb Mon Sep 17 00:00:00 2001 From: ketmar Date: Wed, 11 Dec 2013 19:48:33 +0200 Subject: [PATCH] standalone test: fixed major bug --- src/main_unp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main_unp.c b/src/main_unp.c index 88cb9f2..77f6aab 100644 --- a/src/main_unp.c +++ b/src/main_unp.c @@ -35,7 +35,7 @@ static int fdi = -1; static int fdo = -1; static int rdcur = 0, rdtotal = 0; -#ifndef _NDEBUG +#ifdef NDEBUG # define OUTBUF_SIZE (1024*1024) #else # define OUTBUF_SIZE 1 @@ -62,7 +62,7 @@ static int bread (void *buf, int buf_len, void *udata) { int main (int argc, char *argv[]) { haunp_t hup; int res = 0; -#ifndef _NDEBUG +#ifndef NDEBUG if (argc != 3) { argc = 3; argv[1] = "egatiles.dd2.haz"; @@ -87,8 +87,9 @@ int main (int argc, char *argv[]) { lseek(fdi, 0, SEEK_SET); hup = haunp_open_io(bread, NULL); wrbuf = malloc(OUTBUF_SIZE); + printf("output buffer size: %d\n", OUTBUF_SIZE); for (;;) { - int rd = haunp_read(hup, wrbuf, sizeof(wrbuf)); + int rd = haunp_read(hup, wrbuf, OUTBUF_SIZE); if (rd <= 0) { pbar_clear(); if (rd < 0) fprintf(stdout, "READ ERROR!\n"); -- 2.11.4.GIT