diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | io.c | 3 | ||||
-rw-r--r-- | profile.c | 2 |
3 files changed, 5 insertions, 4 deletions
@@ -5,8 +5,8 @@ * command.y (append_statement): Ditto. * debug.c (gprintf, serialize): Ditto. * field.c (set_FIELDWIDTHS): Ditto. - * io.c.c (init_awkpath, grow_iop_buffer): Ditto. - * profile.c (pp_string, pp_concat, pp_group3): Ditto. + * io.c.c (grow_iop_buffer): Ditto. + * profile.c (pp_string, pp_group3): Ditto. 2014-12-14 Andrew J. Schorr <aschorr@telemetry-investments.com> @@ -2554,7 +2554,8 @@ init_awkpath(path_info *pi) end++; len = end - start; if (len > 0) { - emalloc(p, char *, len + 1, "init_awkpath"); + /* +2 is correct here; leave room for / */ + emalloc(p, char *, len + 2, "init_awkpath"); memcpy(p, start, len); /* add directory punctuation if necessary */ @@ -1505,7 +1505,7 @@ pp_concat(int nargs) len = -delimlen; for (i = nargs; i >= 1; i--) { r = pp_args[i] = pp_pop(); - len += r->pp_len + delimlen + 1; + len += r->pp_len + delimlen + 2; } emalloc(str, char *, len + 1, "pp_concat"); |