summaryrefslogtreecommitdiff
path: root/str_array.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2017-01-27 13:25:02 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2017-01-27 13:25:02 -0500
commita7addf98875555f48f30e7a9260f39a36a7b3e75 (patch)
tree585ab531aaf54a667a4b5618bf9b476d0eaf4793 /str_array.c
parentf1507d4056a6f4e2a9cd5091a495175cbfb840ae (diff)
downloadgawk-a7addf98875555f48f30e7a9260f39a36a7b3e75.tar.gz
Introduce some helpful macros for terminating strings, and fix overrun in dcgettext.
Diffstat (limited to 'str_array.c')
-rw-r--r--str_array.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/str_array.c b/str_array.c
index c559a39a..fe07ce4b 100644
--- a/str_array.c
+++ b/str_array.c
@@ -776,10 +776,9 @@ env_remove(NODE *symbol, NODE *subs)
char save;
if (val != NULL) {
- save = subs->stptr[subs->stlen];
- subs->stptr[subs->stlen] = '\0';
+ str_terminate(subs, save);
(void) unsetenv(subs->stptr);
- subs->stptr[subs->stlen] = save;
+ str_restore(subs, save);
}
return val;