diff options
author | John Keeping <john@keeping.me.uk> | 2016-01-16 11:03:06 +0000 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-01-17 17:05:19 +0100 |
commit | 3fbfced7401cfcbb8006a9a6ce4add6b37a41a55 (patch) | |
tree | ba068905ab00c96c3528783649467c4b3b8aad65 | |
parent | baa5ad1f80f56d3c0b0095bfb468fab28c9b4982 (diff) | |
download | cgit-3fbfced7401cfcbb8006a9a6ce4add6b37a41a55.tar.gz cgit-3fbfced7401cfcbb8006a9a6ce4add6b37a41a55.tar.bz2 cgit-3fbfced7401cfcbb8006a9a6ce4add6b37a41a55.zip |
cache: use size_t for string lengths
Avoid integer truncation on 64-bit systems.
Coverity-id: 13864
Signed-off-by: John Keeping <john@keeping.me.uk>
-rw-r--r-- | cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -24,7 +24,7 @@ struct cache_slot { const char *key; - int keylen; + size_t keylen; int ttl; cache_fill_fn fn; int cache_fd; @@ -44,7 +44,7 @@ struct cache_slot { static int open_slot(struct cache_slot *slot) { char *bufz; - int bufkeylen = -1; + ssize_t bufkeylen = -1; slot->cache_fd = open(slot->cache_name, O_RDONLY); if (slot->cache_fd == -1) |