-/* $OpenBSD: extern.h,v 1.8 2015/01/19 15:30:52 krw Exp $ */
+/* $OpenBSD: extern.h,v 1.9 2015/04/13 05:11:23 deraadt Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
* Copyright (c) 1992, 1993
extern regmatch_t *match;
extern size_t maxnsub;
extern u_long linenum;
-extern int appendnum;
+extern size_t appendnum;
extern int lastline;
extern int Eflag, aflag, eflag, nflag;
extern char *fname;
-/* $OpenBSD: process.c,v 1.21 2014/12/12 03:22:35 jsg Exp $ */
+/* $OpenBSD: process.c,v 1.22 2015/04/13 05:11:23 deraadt Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
struct s_appends *appends; /* Array of pointers to strings to append. */
static int appendx; /* Index into appends array. */
-int appendnum; /* Size of appends array. */
+size_t appendnum; /* Size of appends array. */
static int lastaddr; /* Set by applies if last address of a range. */
static int sdone; /* If any substitutes since last line input. */
case 'a':
if (appendx >= appendnum) {
appends = xreallocarray(appends,
- appendnum *= 2,
- sizeof(struct s_appends));
+ appendnum,
+ 2 * sizeof(struct s_appends));
appendnum *= 2;
}
appends[appendx].type = AP_STRING;
flush_appends();
exit(0);
case 'r':
- if (appendx >= appendnum)
+ if (appendx >= appendnum) {
appends = xreallocarray(appends,
- appendnum *= 2,
- sizeof(struct s_appends));
+ appendnum,
+ 2 * sizeof(struct s_appends));
+ appendnum *= 2;
+ }
appends[appendx].type = AP_FILE;
appends[appendx].s = cp->t;
appends[appendx].len = strlen(cp->t);