-/* $OpenBSD: parse.y,v 1.16 2013/11/25 12:51:10 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.17 2014/05/18 16:36:41 espie Exp $ */
/*
* Copyright (c) 2006 Bob Beck <beck@openbsd.org>
changeropts : DRIVE STRING {
void *newp;
- if ((newp = realloc(curchanger->drives,
- (curchanger->drivecnt + 1) *
+ if ((newp = reallocarray(curchanger->drives,
+ curchanger->drivecnt + 1,
sizeof(curchanger->drives))) == NULL)
err(1, NULL);
curchanger->drives = newp;
-/* $OpenBSD: glbl.c,v 1.13 2012/12/04 02:40:48 deraadt Exp $ */
+/* $OpenBSD: glbl.c,v 1.14 2014/05/18 16:36:42 espie Exp $ */
/* $NetBSD: glbl.c,v 1.2 1995/03/21 09:04:41 cgd Exp $ */
/* glob.c: This file contains the global command routines for the ed line
int ti = active_size;
line_t **ts;
SPL1();
- if ((ts = (line_t **) realloc(active_list,
- (ti += MINBUFSZ) * sizeof(line_t **))) == NULL) {
+ if ((ts = reallocarray(active_list,
+ (ti += MINBUFSZ), sizeof(line_t **))) == NULL) {
perror(NULL);
seterrmsg("out of memory");
SPL0();
-/* $OpenBSD: undo.c,v 1.11 2012/12/04 02:40:48 deraadt Exp $ */
+/* $OpenBSD: undo.c,v 1.12 2014/05/18 16:36:42 espie Exp $ */
/* $NetBSD: undo.c,v 1.2 1995/03/21 09:04:52 cgd Exp $ */
/* undo.c: This file contains the undo routines for the ed line editor */
t = ustack;
if (u_p < usize ||
- (t = (undo_t *) realloc(ustack, (usize += USIZE) * sizeof(undo_t))) != NULL) {
+ (t = reallocarray(ustack, (usize += USIZE), sizeof(undo_t))) != NULL) {
ustack = t;
ustack[u_p].type = type;
ustack[u_p].t = get_addressed_line_node(to);