]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
small cleanups
authorMichael Schroeder <mls@suse.de>
Thu, 31 Jan 2013 15:49:15 +0000 (16:49 +0100)
committerMichael Schroeder <mls@suse.de>
Thu, 31 Jan 2013 15:49:15 +0000 (16:49 +0100)
ext/repo_arch.c
ext/repo_rpmmd.c

index ebf42d38d186d099c8be14271b0a12f132777999..835899ee2ff5d290815eab1d6a6745cd14f73f0c 100644 (file)
@@ -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')
index b765e5bd9281f3c5cdb4df8cb433e57d8ad1cdc6..81790a84ff0264f5a45d78d143b433f09f1dea6e 100644 (file)
@@ -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;