From 2a9ec169562d289667ec485a090ecc33f72c5e2f Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 25 Nov 2019 13:21:38 +0000 Subject: Don't rely on type autopromotion --- src/caches/dcache_add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/caches/dcache_add.c b/src/caches/dcache_add.c index a534f7a..bbe5fea 100644 --- a/src/caches/dcache_add.c +++ b/src/caches/dcache_add.c @@ -80,7 +80,7 @@ static inline int dcache_add_node (dcache_t *z, dcache_node_t const *node) static inline int dcache_add_unbounded (dcache_t *z, char const *key, uint16_t keylen, char const *data, uint16_t datalen, tain_t const *expire, tain_t const *stamp) { - uint32_t len = keylen + datalen ; + uint32_t len = (uint32_t)keylen + (uint32_t)datalen ; dcache_node_t y = { .key = { .s = alloc(len) } } ; if (!y.key.s) return 0 ; memcpy(y.key.s, key, keylen) ; -- cgit v1.2.3