From 992807bce205b56b9172da368a50de4c50be9588 Mon Sep 17 00:00:00 2001 From: otto <> Date: Sat, 22 Oct 2016 14:27:19 +0000 Subject: [PATCH] - fix MALLOC_STATS compile - redundant cast is redundant --- src/lib/libc/stdlib/malloc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index 09baaf96..063bdb07 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.206 2016/10/21 15:39:31 otto Exp $ */ +/* $OpenBSD: malloc.c,v 1.207 2016/10/22 14:27:19 otto Exp $ */ /* * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek * Copyright (c) 2012 Matthew Dempsky @@ -286,9 +286,12 @@ wrterror(struct dir_info *d, char *msg, ...) writev(STDERR_FILENO, iov, 3); #ifdef MALLOC_STATS - if (mopts.malloc_stats) + if (mopts.malloc_stats) { + int i; + for (i = 0; i < _MALLOC_MUTEXES; i++) malloc_dump(STDERR_FILENO, mopts.malloc_pool[i]); + } #endif /* MALLOC_STATS */ errno = saved_errno; @@ -1042,7 +1045,7 @@ validate_canary(struct dir_info *d, u_char *ptr, size_t sz, size_t allocated) if (check_sz > CHUNK_CHECK_LENGTH) check_sz = CHUNK_CHECK_LENGTH; - p = (u_char *)ptr + sz; + p = ptr + sz; q = p + check_sz; while (p < q) {