From b67dbe668b0c257b7890b253ae8b6ae92ec0580e Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Wed, 17 Feb 2010 14:36:33 +0000 Subject: [PATCH] Honour ctype(3) caveats section. --- src/examples/nfc-mfclassic.c | 4 ++-- src/examples/nfc-mfultralight.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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) {