Simplify argc counting.

This commit is contained in:
Andrius Štikonas 2023-12-31 20:05:06 +00:00
parent ac13be4291
commit db2d001395
Signed by: andrius
GPG Key ID: 0C0331D5228A3B62
1 changed files with 1 additions and 6 deletions

View File

@ -197,13 +197,8 @@ int sys_execve(char* file_name, char** argv, char** envp, void, void, void)
}
current_process->entry_point = entry_point(current_process->program.address);
char** iter = argv;
int argc;
while(*iter != 0) {
iter += sizeof(char *);
argc += 1;
}
for(argc = 0; argv[argc] != 0; argc += 1) {}
jump(current_process->entry_point, argc, argv, envp);
}