Skip to content

Commit

Permalink
Assign return of getopt to explicitly signed type. Fixes #2, Closes 3
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 authored Jul 22, 2024
1 parent dd49edd commit 8c8a39c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yksoft.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ int main(int argc, char *argv[])
yksoft_t yksoft;
char otp[(YUBIKEY_UID_SIZE * 2) + YUBIKEY_OTP_SIZE + 1];
char const *file;
char c;
int c; /* needs to be int to work on systems with unsigned char type */
struct stat pstat;
char const *token_dir = NULL;
char token_dir_exp[PATH_MAX + 1];
Expand Down Expand Up @@ -605,7 +605,7 @@ int main(int argc, char *argv[])

memset(&yksoft, 0, sizeof(yksoft));

while ((c = getopt(argc, argv, "c:C:df:I:i:k:rRh")) != -1) switch (c) {
while ((c = getopt(argc, argv, "c:C:df:I:i:k:rRh")) != -1) switch ((char)c) {
case 'c':
counter = strtol((char *)optarg, NULL, 0);
got_counter = true;
Expand Down

0 comments on commit 8c8a39c

Please sign in to comment.