diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-11-12 19:12:13 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-11-12 19:12:13 +0200 |
commit | cc04afb329cea035d0d9b67cd3b677e06b2f3996 (patch) | |
tree | 3622f3f241d75079bcafd24651a4952e357a9c09 /gawkapi.c | |
parent | 9a31c12053ef715ccb732f456de00b4afc38d888 (diff) | |
download | gawk-feature/nocopy.tar.gz |
Further code improvements and doc changes as diff until merge.feature/nocopy
Diffstat (limited to 'gawkapi.c')
-rw-r--r-- | gawkapi.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -396,6 +396,8 @@ static struct { size_t i, size; } scopy; +/* free_api_string_copies --- release memory used by string copies */ + void free_api_string_copies() { @@ -406,7 +408,7 @@ free_api_string_copies() scopy.i = 0; } -/* return a node string with nul termination */ +/* assign_string --- return a string node with NUL termination */ static inline void assign_string(NODE *node, awk_value_t *val) @@ -418,6 +420,7 @@ assign_string(NODE *node, awk_value_t *val) * This should happen only for $n where n > 0 and n < NF. */ char *s; + assert((node->flags & MALLOC) == 0); if (scopy.i == scopy.size) { /* expand list */ |