aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-06-25 19:59:47 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-06-25 19:59:47 +0530
commit37e5e6189a10ce0da8df4dbdb64398cf7a02c0bd (patch)
tree1dbf7a78b39ddfaf246b74152304555386bead23 /src
parent235eb296149ff1d16accadc37c52542b7f18ef2d (diff)
downloadnnn-37e5e6189a10ce0da8df4dbdb64398cf7a02c0bd.tar.gz
Simplify check
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nnn.c b/src/nnn.c
index ef20b13..4e14057 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4321,13 +4321,11 @@ static void readpipe(int fd, char **path, char **lastname, char **lastdir)
char ctx, *nextpath = NULL;
ssize_t len = read_nointr(fd, g_buf, 1);
- if (len != 1)
+ if (len != 1 || g_buf[0] < '0')
return;
if (g_buf[0] == '+')
ctx = (char)(get_free_ctx() + 1);
- else if (g_buf[0] < '0')
- return;
else {
ctx = g_buf[0] - '0';
if (ctx > CTX_MAX)