aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-10-31 22:00:47 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-10-31 22:00:47 +0200
commit25204a8fa9c1ea218de1dded3e2a70a5b2aa0021 (patch)
tree44952ccc886e40f62d029b96258b7fb089c01125 /io.c
parent867c0f3a5a40edea730139a0acf6920ba0e660c9 (diff)
parenta4d313ca20a63d28b7a2020e6897f4e3e04dae6e (diff)
downloadegawk-25204a8fa9c1ea218de1dded3e2a70a5b2aa0021.tar.gz
egawk-25204a8fa9c1ea218de1dded3e2a70a5b2aa0021.tar.bz2
egawk-25204a8fa9c1ea218de1dded3e2a70a5b2aa0021.zip
Merge branch 'master' into feature/cmake
Diffstat (limited to 'io.c')
-rw-r--r--io.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/io.c b/io.c
index 816ff56a..6f9ffbf6 100644
--- a/io.c
+++ b/io.c
@@ -2742,8 +2742,9 @@ init_awkpath(path_info *pi)
if (*p == envsep)
max_path++;
- emalloc(pi->awkpath, char **, (max_path + 1) * sizeof(char *), "init_awkpath");
- memset(pi->awkpath, 0, (max_path + 1) * sizeof(char *));
+ // +3 --> 2 for null entries at front and end of path, 1 for NULL end of list
+ emalloc(pi->awkpath, char **, (max_path + 3) * sizeof(char *), "init_awkpath");
+ memset(pi->awkpath, 0, (max_path + 3) * sizeof(char *));
start = path;
i = 0;