summaryrefslogtreecommitdiff
path: root/src/user/lib/stdlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/lib/stdlib.c')
-rw-r--r--src/user/lib/stdlib.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/user/lib/stdlib.c b/src/user/lib/stdlib.c
index 11ca7b6..857b40e 100644
--- a/src/user/lib/stdlib.c
+++ b/src/user/lib/stdlib.c
@@ -36,11 +36,9 @@ int execv(const char *path, char *const argv[]) {
fseek(file, 2, SEEK_SET);
if (fgets(buf, sizeof buf, file)) {
const char *argv [] = {buf, path, NULL};
- // TODO strchr
- char *s = buf;
- while (*s && *s != '\n') s++;
- *s = '\0';
- execv(argv[0], (void*)argv);
+ char *endl = strchr(buf, '\n');
+ if (endl) *endl = '\0';
+ execv(buf, (void*)argv);
}
}