diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 23:14:53 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 23:14:53 +0100 |
| commit | 169daa11155988a210fac949297381743f3cb400 (patch) | |
| tree | 602ef5df5ae9ea075ab3d5dac3c8ad60da1ea2cc /lib/libc/unistd/execvp.c | |
| parent | 4e2112e165fdd94dee58378e3ea32892f3710cd7 (diff) | |
feat: clang-tidy fixes
Diffstat (limited to 'lib/libc/unistd/execvp.c')
| -rw-r--r-- | lib/libc/unistd/execvp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/unistd/execvp.c b/lib/libc/unistd/execvp.c index 88cde91e..26934a76 100644 --- a/lib/libc/unistd/execvp.c +++ b/lib/libc/unistd/execvp.c @@ -1,6 +1,8 @@ +#include "stddef.h" // for NULL + #include <errno.h> // for errno, ENAMETOOLONG, ENOENT #include <limits.h> // for PATH_MAX -#include <stdio.h> // for NULL, snprintf +#include <stdio.h> // for snprintf #include <stdlib.h> // for getenv #include <string.h> // for strchr, strlen, strstr #include <unistd.h> // for execv, execvp @@ -27,7 +29,8 @@ int execvp(const char *file, char *const argv[]) do { char buf[PATH_MAX]; - if ((ptr = strchr(path, ':')) == NULL) { + ptr = strchr(path, ':'); + if (ptr == NULL) { if (snprintf(buf, PATH_MAX, "%s/%s", path, file) >= PATH_MAX) { errno = ENAMETOOLONG; |
