summaryrefslogtreecommitdiff
path: root/lib/libc/unistd/getopt.c
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-09 23:14:53 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-09 23:14:53 +0100
commit169daa11155988a210fac949297381743f3cb400 (patch)
tree602ef5df5ae9ea075ab3d5dac3c8ad60da1ea2cc /lib/libc/unistd/getopt.c
parent4e2112e165fdd94dee58378e3ea32892f3710cd7 (diff)
feat: clang-tidy fixes
Diffstat (limited to 'lib/libc/unistd/getopt.c')
-rw-r--r--lib/libc/unistd/getopt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/unistd/getopt.c b/lib/libc/unistd/getopt.c
index 0a3b38cb..c942da56 100644
--- a/lib/libc/unistd/getopt.c
+++ b/lib/libc/unistd/getopt.c
@@ -56,7 +56,7 @@ int getopt(int argc, char *const argv[], const char *optstring)
} while (d && d != c);
if (d != c || c == ':') {
- optopt = c;
+ optopt = (unsigned char)c;
if (optstring[0] != ':' && opterr) {
struct iovec iov[4];
char opt_char[2] = { *optchar, '\0' };
@@ -85,7 +85,7 @@ int getopt(int argc, char *const argv[], const char *optstring)
optpos = 0;
}
if (optind > argc) {
- optopt = c;
+ optopt = (unsigned char)c;
if (optstring[0] == ':') {
return ':';
}