]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
data_fetch: set kv->entry to -1 in array case
authorMichael Schroeder <mls@suse.de>
Tue, 18 Sep 2018 11:59:17 +0000 (13:59 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 18 Sep 2018 11:59:17 +0000 (13:59 +0200)
Not that the code is used anywhere...

src/repopack.h

index 3079239873269f1c4f0f002bba280362ddb23f64..b76ae718cd01e34b055cc1fdb5d0fa4eda008f14 100644 (file)
@@ -203,10 +203,11 @@ data_fetch(unsigned char *dp, KeyValue *kv, Repokey *key)
       dp = data_read_id(dp, (Id *)&kv->num);
       return data_read_ideof(dp, (Id *)&kv->num2, &kv->eof);
     case REPOKEY_TYPE_FIXARRAY:
-      dp = data_read_id(dp, (Id *)&kv->num);
-      return data_read_id(dp, &kv->id);
     case REPOKEY_TYPE_FLEXARRAY:
-      return data_read_id(dp, (Id *)&kv->num);
+      kv->entry = -1;
+      dp = data_read_id(dp, (Id *)&kv->num);   /* number of elements */
+      kv->str = (const char *)dp;
+      return dp;
     default:
       return 0;
     }