diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-02-02 15:42:25 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-02-02 15:42:25 +0200 |
commit | c54a8ebdc993aa3bf259fa7ab85a0f077a70040c (patch) | |
tree | 39e4c97c2e88535085abcb2eb094fb2920579336 /awkgram.c | |
parent | 7b46fc2f6243d91e01b6e74fd69b193b4eddb05b (diff) | |
download | egawk-c54a8ebdc993aa3bf259fa7ab85a0f077a70040c.tar.gz egawk-c54a8ebdc993aa3bf259fa7ab85a0f077a70040c.tar.bz2 egawk-c54a8ebdc993aa3bf259fa7ab85a0f077a70040c.zip |
Improve memory hygiene in set_profile_text.
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |