diff options
author | Michael Schroeder <mls@suse.de> | 2013-01-31 16:49:15 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2013-01-31 16:49:15 +0100 |
commit | 9eb59bbb93038fce3233052d93f7f50521ebfef5 (patch) | |
tree | 075cc1808bdac33a901eeccc8208088bb3d1a1db /ext/repo_arch.c | |
parent | 1e554802e7188a10cc9040d5067d7ebf6b3fe0f3 (diff) | |
download | libsolv-9eb59bbb93038fce3233052d93f7f50521ebfef5.tar.gz libsolv-9eb59bbb93038fce3233052d93f7f50521ebfef5.tar.bz2 libsolv-9eb59bbb93038fce3233052d93f7f50521ebfef5.zip |
small cleanups
Diffstat (limited to 'ext/repo_arch.c')
-rw-r--r-- | ext/repo_arch.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/repo_arch.c b/ext/repo_arch.c index ebf42d3..835899e 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') |