summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-07-11 12:33:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-07-11 12:33:51 -0700
commit22a0514369a0a377f8c5d40675fea68adaf1d333 (patch)
tree21c2895aff1a04fad3dbfd56f91878a462b80231
parent1c3daa4cd43f95d246b5b5312216c7195fdcded0 (diff)
downloadtxr-22a0514369a0a377f8c5d40675fea68adaf1d333.tar.gz
txr-22a0514369a0a377f8c5d40675fea68adaf1d333.tar.bz2
txr-22a0514369a0a377f8c5d40675fea68adaf1d333.zip
chk_calloc: use unsigned arithmetic.
* lib.c (chk_calloc): Use unsigned arithmetic to figure out the total, which is only used for incrementing the malloc_bytes counter. The unsigned arithmetic is performed in the same type as that counter.
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 1e7d8885..db59cd60 100644
--- a/lib.c
+++ b/lib.c
@@ -2839,7 +2839,7 @@ mem_t *chk_malloc_gc_more(size_t size)
mem_t *chk_calloc(size_t n, size_t size)
{
mem_t *ptr = convert(mem_t *, calloc(n, size));
- cnum total = convert(cnum, size) * convert(cnum, n);
+ alloc_bytes_t total = convert(alloc_bytes_t, size) * n;
assert (!async_sig_enabled);