From 39f11b8a56090491e62e6bf45577de7cdcc506a7 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Sat, 10 Jul 2004 11:41:27 +0000 Subject: xmalloc()->xrealloc() so that patterns larger than _POSIX2_LINE_MAX*2-1 work. From mycroft@netbsd. ok millert@ --- usr.bin/sed/compile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index f32c6daddb9..7bca0152f39 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compile.c,v 1.19 2004/07/09 19:39:40 otto Exp $ */ +/* $OpenBSD: compile.c,v 1.20 2004/07/10 11:41:26 otto Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. @@ -35,7 +35,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)compile.c 8.2 (Berkeley) 4/28/95"; */ -static char *rcsid = "$OpenBSD: compile.c,v 1.19 2004/07/09 19:39:40 otto Exp $"; +static char *rcsid = "$OpenBSD: compile.c,v 1.20 2004/07/10 11:41:26 otto Exp $"; #endif /* not lint */ #include @@ -503,7 +503,7 @@ compile_subst(char *p, struct s_subst *s) size += sp - op; if (asize - size < _POSIX2_LINE_MAX + 1) { asize *= 2; - text = xmalloc(asize); + text = xrealloc(text, asize); } } while (cu_fgets(p = lbuf, sizeof(lbuf))); err(COMPILE, "unterminated substitute in regular expression"); -- cgit v1.2.3