aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-10-31 22:01:14 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-10-31 22:01:14 +0200
commitce01568de72d8413edddbe23db14031787667d12 (patch)
treee1e98c816a833dd5363946d2570648dcd48afb19 /io.c
parent4e7f84903580b2bc46946edc93b66b18f1f64e5c (diff)
parenta4d313ca20a63d28b7a2020e6897f4e3e04dae6e (diff)
downloadegawk-ce01568de72d8413edddbe23db14031787667d12.tar.gz
egawk-ce01568de72d8413edddbe23db14031787667d12.tar.bz2
egawk-ce01568de72d8413edddbe23db14031787667d12.zip
Merge branch 'master' into feature/nocopy
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 f67df9d6..354420b1 100644
--- a/io.c
+++ b/io.c
@@ -2741,8 +2741,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;