aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-02-28 19:30:50 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-02-28 19:36:00 +0530
commitd1fcc5351e43577c59bd9c89699f7241cea8052a (patch)
tree9285147f26a24c41faef971a4851fc2c66d36760 /src/nnn.c
parent88167511f60d36ade74e209eb5b9318a828f6954 (diff)
downloadnnn-d1fcc5351e43577c59bd9c89699f7241cea8052a.tar.gz
Fix lint
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 2e02150..7835be6 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2921,6 +2921,10 @@ static bool parsekvpair(kv **arr, char **envcpy, const uchar id, ushort *items)
kvarr = *arr;
*envcpy = strdup(ptr);
+ if (!*envcpy) {
+ xerror();
+ return FALSE;
+ }
ptr = *envcpy;
nextkey = ptr;
@@ -2948,7 +2952,7 @@ static bool parsekvpair(kv **arr, char **envcpy, const uchar id, ushort *items)
}
if (i < maxitems) {
- if (*kvarr[i - 1].val == '\0')
+ if (kvarr[i - 1].val && *kvarr[i - 1].val == '\0')
return FALSE;
kvarr[i].key = '\0';
}