summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2016-07-06 20:32:03 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2016-07-06 20:32:03 +0000
commit5a1fbc606ce54af07ba7d7ccd5b37de60d953bc0 (patch)
tree7caefe530b96bb07d13a4c0eb46ef58f763ab921 /lib
parent5f70d465bea51a3206aa02e7e445a715bdc97f33 (diff)
J/j is a three valued option, document and fix code to actuall support that
with a little help from jmc@ for the man page bits ok jca@ and a reluctant tedu@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/malloc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 678c782d200..b4c0010f357 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.191 2016/06/30 09:00:48 otto Exp $ */
+/* $OpenBSD: malloc.c,v 1.192 2016/07/06 20:32:02 otto Exp $ */
/*
* Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -533,10 +533,12 @@ omalloc_parseopt(char opt)
mopts.malloc_hint = 1;
break;
case 'j':
- mopts.malloc_junk = 0;
+ if (mopts.malloc_junk > 0)
+ mopts.malloc_junk--;
break;
case 'J':
- mopts.malloc_junk = 2;
+ if (mopts.malloc_junk < 2)
+ mopts.malloc_junk++;
break;
case 'n':
case 'N':