From 2eabb1b6c811199d42ecff09dbcc846eceebfb0b Mon Sep 17 00:00:00 2001 From: Nikolay Pelov Date: Sat, 7 Dec 2019 18:31:16 +0200 Subject: [PATCH] fixed bug with program path --- port-open.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/port-open.c b/port-open.c index 8c82aca..cbb3582 100644 --- a/port-open.c +++ b/port-open.c @@ -23,7 +23,6 @@ char *name; char progPath[1026]; -bool hasDir = false; int program = 1; long timeout = 0; @@ -188,8 +187,8 @@ int main(int argc, char **argv){ }else { strncpy(progPath, dirTemp, 1024); int len = strlen(progPath); - progPath[len-1] = '/'; - progPath[len] = 0; + progPath[len] = '/'; + progPath[len+1] = 0; } switch(program){