Skip to content

Commit

Permalink
Don't log first arg, remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Oct 29, 2023
1 parent 1ec124b commit 95f3ba0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions BaseBin/launchdhook/src/spawn_hook.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ int posix_spawn_hook(pid_t *restrict pid, const char *restrict path,
char *const envp[restrict])
{
if (path) {
const char *firstArg = "<none>";
if (argv[0]) {
if (argv[1]) {
firstArg = argv[1];
}
}

char executablePath[1024];
uint32_t bufsize = sizeof(executablePath);
_NSGetExecutablePath(&executablePath[0], &bufsize);
Expand Down Expand Up @@ -71,7 +64,10 @@ int posix_spawn_hook(pid_t *restrict pid, const char *restrict path,
int ai = 0;
while (true) {
if (argv[ai]) {
fprintf(f, " %s", argv[ai++]);
if (ai >= 1) {
fprintf(f, " %s", argv[ai]);
}
ai++;
}
else {
break;
Expand Down

0 comments on commit 95f3ba0

Please sign in to comment.