diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-02-02 15:57:58 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-02-02 15:57:58 +0200 |
commit | 260c2d0fa556c5c79297fa063a3673c1bb814115 (patch) | |
tree | b0ebc5c9c42a2f9a5cc5a3cb7609b6f43f56756e | |
parent | ec480355cc6c93d36a0ae4b95018389455f11a8d (diff) | |
parent | f0b9ec9b838045318bcc8512c48dd93c66d4eef5 (diff) | |
download | egawk-260c2d0fa556c5c79297fa063a3673c1bb814115.tar.gz egawk-260c2d0fa556c5c79297fa063a3673c1bb814115.tar.bz2 egawk-260c2d0fa556c5c79297fa063a3673c1bb814115.zip |
Merge branch 'master' into feature/api-mpfr
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | awkgram.c | 6 | ||||
-rw-r--r-- | awkgram.y | 6 |
3 files changed, 11 insertions, 6 deletions
@@ -4,6 +4,11 @@ end for the NUL in case we add a sign. Thanks to Andrew Schorr for making me look at this code. + And later in the same day: + + * awkgram.y (set_profile_next): Undo previous change, since estrdup + handles it, but updated the comments. + 2017-02-01 Arnold D. Robbins <arnold@skeeve.com> * builtin.c (mbc_char_count): Remove spurious multiplies by @@ -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 @@ -6292,9 +6292,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 |