diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-07-10 11:41:27 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-07-10 11:41:27 +0000 |
commit | 39f11b8a56090491e62e6bf45577de7cdcc506a7 (patch) | |
tree | 2dd2d9915c7f0cbcd79da3ba0d326a10c76c29b2 /usr.bin | |
parent | dec054a549da59ea504b6f4a94b6214e69aa06d3 (diff) |
xmalloc()->xrealloc() so that patterns larger than _POSIX2_LINE_MAX*2-1
work. From mycroft@netbsd.
ok millert@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/sed/compile.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 <sys/types.h> @@ -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"); |