aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-02-02 15:57:30 +0200
committerArnold D. Robbins <arnold@skeeve.com>2017-02-02 15:57:30 +0200
commitf0b9ec9b838045318bcc8512c48dd93c66d4eef5 (patch)
treed5d6f0c406c3f767116f7ee0609762444de521d3 /awkgram.c
parentc54a8ebdc993aa3bf259fa7ab85a0f077a70040c (diff)
downloadegawk-f0b9ec9b838045318bcc8512c48dd93c66d4eef5.tar.gz
egawk-f0b9ec9b838045318bcc8512c48dd93c66d4eef5.tar.bz2
egawk-f0b9ec9b838045318bcc8512c48dd93c66d4eef5.zip
Undo change, but update comments as to why not needed.
Diffstat (limited to 'awkgram.c')
-rw-r--r--awkgram.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/awkgram.c b/awkgram.c
index fb6e4825..a39fff22 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -8712,9 +8712,9 @@ static NODE *
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
- // and another one for the \0 at the end
- n->stptr = estrdup(str, len + 2);
+ // extra byte in case we need to add minus sign in negate_num
+ // note that estrdup adds another byte for the \0 at the end
+ n->stptr = estrdup(str, len + 1);
n->stptr[len] = '\0';
n->stlen = len;
// Set STRCUR and n->stfmt for use when profiling