diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-28 16:46:05 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-28 16:46:05 +0300 |
commit | 6853b3e94c03194200c5a7c4450820a8eaa0920f (patch) | |
tree | 0e68baf9f5d687a0a3b6543f01522a56bf010279 /interpret.h | |
parent | 020be4cb81b519a597acbf85e683cfb95993c2b9 (diff) | |
parent | b4ef28f58688cf3c3a5878c595b6582144ee2cf1 (diff) | |
download | egawk-6853b3e94c03194200c5a7c4450820a8eaa0920f.tar.gz egawk-6853b3e94c03194200c5a7c4450820a8eaa0920f.tar.bz2 egawk-6853b3e94c03194200c5a7c4450820a8eaa0920f.zip |
Merge branch 'master' into feature/regex-type
Diffstat (limited to 'interpret.h')
-rw-r--r-- | interpret.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/interpret.h b/interpret.h index b76952f1..03532f43 100644 --- a/interpret.h +++ b/interpret.h @@ -709,7 +709,7 @@ mod: if (t1 != t2 && t1->valref == 1 && (t1->flags & MPFN) == 0) { size_t nlen = t1->stlen + t2->stlen; - erealloc(t1->stptr, char *, nlen + 2, "r_interpret"); + erealloc(t1->stptr, char *, nlen + 1, "r_interpret"); memcpy(t1->stptr + t1->stlen, t2->stptr, t2->stlen); t1->stlen = nlen; t1->stptr[nlen] = '\0'; @@ -719,7 +719,7 @@ mod: size_t wlen = t1->wstlen + t2->wstlen; erealloc(t1->wstptr, wchar_t *, - sizeof(wchar_t) * (wlen + 2), "r_interpret"); + sizeof(wchar_t) * (wlen + 1), "r_interpret"); memcpy(t1->wstptr + t1->wstlen, t2->wstptr, t2->wstlen); t1->wstlen = wlen; t1->wstptr[wlen] = L'\0'; @@ -730,9 +730,10 @@ mod: size_t nlen = t1->stlen + t2->stlen; char *p; - emalloc(p, char *, nlen + 2, "r_interpret"); + emalloc(p, char *, nlen + 1, "r_interpret"); memcpy(p, t1->stptr, t1->stlen); memcpy(p + t1->stlen, t2->stptr, t2->stlen); + /* N.B. No NUL-termination required, since make_str_node will do it. */ unref(*lhs); t1 = *lhs = make_str_node(p, nlen, ALREADY_MALLOCED); } |