From: Michael Schroeder Date: Thu, 31 Jan 2013 15:49:15 +0000 (+0100) Subject: small cleanups X-Git-Tag: BASE-SuSE-Code-12_3-Branch~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eb59bbb93038fce3233052d93f7f50521ebfef5;p=thirdparty%2Flibsolv.git small cleanups --- diff --git a/ext/repo_arch.c b/ext/repo_arch.c index ebf42d38..835899ee 100644 --- a/ext/repo_arch.c +++ b/ext/repo_arch.c @@ -196,14 +196,14 @@ static int gettarhead(struct tarhead *th) char *data, *pp; if (length < 1 || length >= 1024 * 1024) return -1; - l = length; - data = pp = solv_malloc(l + 512); - for (; l > 0; l -= 512, pp += 512) + data = pp = solv_malloc(length + 512); + for (l = length; l > 0; l -= 512, pp += 512) if (readblock(th->fp, (unsigned char *)pp)) { solv_free(data); return -1; } + data[length] = 0; type = 3; /* extension */ if (th->blk[156] == 'L') { @@ -216,7 +216,6 @@ static int gettarhead(struct tarhead *th) while (length > 0) { int ll = 0; - int l; for (l = 0; l < length && pp[l] >= '0' && pp[l] <= '9'; l++) ll = ll * 10 + (pp[l] - '0'); if (l == length || pp[l] != ' ' || ll < 1 || ll > length || pp[ll - 1] != '\n') diff --git a/ext/repo_rpmmd.c b/ext/repo_rpmmd.c index b765e5bd..81790a84 100644 --- a/ext/repo_rpmmd.c +++ b/ext/repo_rpmmd.c @@ -224,11 +224,6 @@ static struct stateswitch stateswitches[] = { { NUMSTATES} }; -/* maxmum initial size of - the checksum cache */ -#define MAX_CSCACHE 32768 -#define CSREALLOC_STEP 1024 - struct parsedata { int ret; Pool *pool;