Honour ctype(3) caveats section.

This commit is contained in:
Romain Tartiere 2010-02-17 14:36:33 +00:00
parent e0d8e80b76
commit b67dbe668b
2 changed files with 3 additions and 3 deletions

View file

@ -353,12 +353,12 @@ int main(int argc, const char* argv[])
if(strcmp(command, "r") == 0) if(strcmp(command, "r") == 0)
{ {
atAction = ACTION_READ; atAction = ACTION_READ;
bUseKeyA = (tolower(*(argv[2])) == 'a'); bUseKeyA = tolower((int)((unsigned char)*(argv[2]))) == 'a';
bUseKeyFile = (argc > 4); bUseKeyFile = (argc > 4);
} else if(strcmp(command, "w") == 0) } else if(strcmp(command, "w") == 0)
{ {
atAction = ACTION_WRITE; atAction = ACTION_WRITE;
bUseKeyA = (tolower(*(argv[2])) == 'a'); bUseKeyA = tolower((int)((unsigned char)*(argv[2]))) == 'a';
bUseKeyFile = (argc > 4); bUseKeyFile = (argc > 4);
} else if(strcmp(command, "x") == 0) } else if(strcmp(command, "x") == 0)
{ {

View file

@ -151,7 +151,7 @@ int main(int argc, const char* argv[])
printf("\nChecking arguments and settings\n"); printf("\nChecking arguments and settings\n");
bReadAction = (tolower(*(argv[1])) == 'r'); bReadAction = tolower((int)((unsigned char)*(argv[1])) == 'r');
if (bReadAction) if (bReadAction)
{ {