diff --git a/src/examples/nfc-mfclassic.c b/src/examples/nfc-mfclassic.c index 732af1a..c164c6e 100644 --- a/src/examples/nfc-mfclassic.c +++ b/src/examples/nfc-mfclassic.c @@ -353,12 +353,12 @@ int main(int argc, const char* argv[]) if(strcmp(command, "r") == 0) { atAction = ACTION_READ; - bUseKeyA = (tolower(*(argv[2])) == 'a'); + bUseKeyA = tolower((int)((unsigned char)*(argv[2]))) == 'a'; bUseKeyFile = (argc > 4); } else if(strcmp(command, "w") == 0) { atAction = ACTION_WRITE; - bUseKeyA = (tolower(*(argv[2])) == 'a'); + bUseKeyA = tolower((int)((unsigned char)*(argv[2]))) == 'a'; bUseKeyFile = (argc > 4); } else if(strcmp(command, "x") == 0) { diff --git a/src/examples/nfc-mfultralight.c b/src/examples/nfc-mfultralight.c index 1d3e304..7779ff4 100644 --- a/src/examples/nfc-mfultralight.c +++ b/src/examples/nfc-mfultralight.c @@ -151,7 +151,7 @@ int main(int argc, const char* argv[]) printf("\nChecking arguments and settings\n"); - bReadAction = (tolower(*(argv[1])) == 'r'); + bReadAction = tolower((int)((unsigned char)*(argv[1])) == 'r'); if (bReadAction) {