]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: cache: Use proper data types in secondary_key_cmp()
authorTim Duesterhus <tim@bastelstu.be>
Mon, 18 Jan 2021 12:41:18 +0000 (13:41 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 18 Jan 2021 14:01:46 +0000 (15:01 +0100)
- hash_length is `unsigned int` and so should offset.
- idx is compared to a `size_t` and thus it should also be.

src/cache.c

index 16dc7d61c2216c94b85c95fcbedb4e9d452fe501..f556fdc0774f302ee32348adf24a50818c093016 100644 (file)
@@ -208,8 +208,8 @@ struct cache_entry *entry_exist(struct cache *cache, char *hash)
 static int secondary_key_cmp(const char *ref_key, const char *new_key)
 {
        int retval = 0;
-       int idx = 0;
-       int offset = 0;
+       size_t idx = 0;
+       unsigned int offset = 0;
        const struct vary_hashing_information *info;
 
        for (idx = 0; idx < sizeof(vary_information)/sizeof(*vary_information) && !retval; ++idx) {