aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-02-02 15:43:51 +0200
committerArnold D. Robbins <arnold@skeeve.com>2017-02-02 15:43:51 +0200
commitb45b98219070df9ba833e3ccc66b1c5bfdc1ebf9 (patch)
tree0d2b9e2e66302b88343c5343d19f596410b620c4 /awkgram.c
parentfb06aea485b8da29c8bf9135d641615c50f37ae7 (diff)
parentc54a8ebdc993aa3bf259fa7ab85a0f077a70040c (diff)
downloadegawk-b45b98219070df9ba833e3ccc66b1c5bfdc1ebf9.tar.gz
egawk-b45b98219070df9ba833e3ccc66b1c5bfdc1ebf9.tar.bz2
egawk-b45b98219070df9ba833e3ccc66b1c5bfdc1ebf9.zip
Merge branch 'master' into feature/stringfix
Diffstat (limited to 'awkgram.c')
-rw-r--r--awkgram.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/awkgram.c b/awkgram.c
index 9c19767b..9a98a7ac 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -8713,7 +8713,8 @@ set_profile_text(NODE *n, const char *str, size_t len)
{
if (do_pretty_print) {
// extra byte in case need to add minus sign in negate_num
- n->stptr = estrdup(str, len + 1);
+ // and another one for the \0 at the end
+ n->stptr = estrdup(str, len + 2);
n->stptr[len] = '\0';
n->stlen = len;
// Set STRCUR and n->stfmt for use when profiling