Skip to content

Commit 3e6f74a

Browse files
authoredJun 22, 2024
Merge pull request #21 from fredericgermain/args_hexa_channel
Allow channel number in hexa in cli argument
2 parents 4894032 + f63d5de commit 3e6f74a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/whsniff.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,11 @@ int main(int argc, char *argv[])
434434
switch (option)
435435
{
436436
case 'c':
437-
channel = (uint8_t)atoi(optarg);
437+
if (strlen(optarg) >= 3 && optarg[0] == '0' && (optarg[1] == 'x' || optarg[1] == 'X')) {
438+
channel = (uint8_t)strtol(optarg, NULL, 16);
439+
} else {
440+
channel = (uint8_t)atoi(optarg);
441+
}
438442
if (channel < 11 || channel > 26)
439443
{
440444

0 commit comments

Comments
 (0)
Please sign in to comment.