From 17d706242bf5cea5cf0db4791d6d6ef163fedc86 Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Sun, 31 Mar 2024 09:45:40 +0200 Subject: [PATCH] fix --- bsd/kinfo_getargv.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bsd/kinfo_getargv.c b/bsd/kinfo_getargv.c index 88fc7a1..5861da9 100644 --- a/bsd/kinfo_getargv.c +++ b/bsd/kinfo_getargv.c @@ -89,10 +89,11 @@ kinfo_getargv(pid_t pid) goto bad; if (buf[0] != '/') { - argv[i++] = kinfo_getpathname(pid); - if (argv[0] == NULL) - goto bad; - off += strlen(buf) + 1; + argv[0] = kinfo_getpathname(pid); + if (argv[0] != NULL) { + off += strlen(buf) + 1; + i++; + } } for (; i < argc; i++) {