summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0f112d6)
* Fix warnings and missing #include for <ctype.h>
* Avoid a warning in client/util.c
int wordCnt = 0;
while(1){
int wordCnt = 0;
while(1){
- while(isspace(str[beginIndex])){
+ while(isspace((unsigned char)str[beginIndex])){
++beginIndex;
}
if(str[beginIndex] == '\0') {
break;
}
endIndex = beginIndex;
++beginIndex;
}
if(str[beginIndex] == '\0') {
break;
}
endIndex = beginIndex;
- while (str[endIndex] && !isspace(str[endIndex])){
+ while (str[endIndex] && !isspace((unsigned char)str[endIndex])){
++endIndex;
}
int len = endIndex - beginIndex;
++endIndex;
}
int len = endIndex - beginIndex;
#include <inttypes.h>
#include <string.h>
#include <unistd.h>
#include <inttypes.h>
#include <string.h>
#include <unistd.h>
#include "util.h"
#include "util_posix.h"
#include "iso14443crc.h"
#include "util.h"
#include "util_posix.h"
#include "iso14443crc.h"
+ if (isxdigit((unsigned char)c)) {
// len = data + PCB(1b) + CRC(2b)
switch(param_gethex_to_eol(cmd, cmdp, data, sizeof(data) - 1 - 2, &datalen)) {
case 1:
// len = data + PCB(1b) + CRC(2b)
switch(param_gethex_to_eol(cmd, cmdp, data, sizeof(data) - 1 - 2, &datalen)) {
case 1:
\r
if( buf[0]=='#' ) continue; //The line start with # is comment, skip\r
\r
\r
if( buf[0]=='#' ) continue; //The line start with # is comment, skip\r
\r
- if (!isxdigit(buf[0])){\r
+ if (!isxdigit((unsigned char)buf[0])){\r
PrintAndLog("File content error. '%s' must include 12 HEX symbols",buf);\r
continue;\r
}\r
PrintAndLog("File content error. '%s' must include 12 HEX symbols",buf);\r
continue;\r
}\r
//The line start with # is comment, skip\r
if( buf[0]=='#' ) continue;\r
\r
//The line start with # is comment, skip\r
if( buf[0]=='#' ) continue;\r
\r
- if (!isxdigit(buf[0])) {\r
+ if (!isxdigit((unsigned char)buf[0])) {\r
PrintAndLog("File content error. '%s' must include 8 HEX symbols", buf);\r
continue;\r
}\r
PrintAndLog("File content error. '%s' must include 8 HEX symbols", buf);\r
continue;\r
}\r
// EMV commands
//-----------------------------------------------------------------------------
// EMV commands
//-----------------------------------------------------------------------------
#include "cmdemv.h"
#include "test/cryptotest.h"
#include "cmdemv.h"
#include "test/cryptotest.h"
+ if (isxdigit((unsigned char)c)) {
switch(param_gethex_to_eol(cmd, cmdp, data, sizeof(data), &datalen)) {
case 1:
PrintAndLog("Invalid HEX value.");
switch(param_gethex_to_eol(cmd, cmdp, data, sizeof(data), &datalen)) {
case 1:
PrintAndLog("Invalid HEX value.");
- } else if (isspace(a[ii])) {
+ } else if (isspace((unsigned char)a[ii])) {
/* ignore */
} else {
/* err ... ignore too*/
/* ignore */
} else {
/* err ... ignore too*/
uerror("cannot allocate memory for comparison string");
akey.name = uptr = ukey;
do
uerror("cannot allocate memory for comparison string");
akey.name = uptr = ukey;
do
- *uptr++ = toupper(*key);
+ *uptr++ = toupper((unsigned char)*key);
while(*key++);
aptr = bsearch(&akey, aliases, NALIASES, sizeof(struct malias), (int (*)(const void *, const void *)) &acmp);
while(*key++);
aptr = bsearch(&akey, aliases, NALIASES, sizeof(struct malias), (int (*)(const void *, const void *)) &acmp);
return 1;
for(i = 0; i < hexcnt; i += 2) {
return 1;
for(i = 0; i < hexcnt; i += 2) {
- if (!(isxdigit(line[bg + i]) && isxdigit(line[bg + i + 1])) ) return 1;
+ if (!(isxdigit((unsigned char)line[bg + i]) && isxdigit((unsigned char)line[bg + i + 1])) ) return 1;
sscanf((char[]){line[bg + i], line[bg + i + 1], 0}, "%X", &temp);
data[i / 2] = temp & 0xff;
sscanf((char[]){line[bg + i], line[bg + i + 1], 0}, "%X", &temp);
data[i / 2] = temp & 0xff;
return 1;
for(i = 0; i < *hexcnt; i += 2) {
return 1;
for(i = 0; i < *hexcnt; i += 2) {
- if (!(isxdigit(line[bg + i]) && isxdigit(line[bg + i + 1])) ) return 1;
+ if (!(isxdigit((unsigned char)line[bg + i]) && isxdigit((unsigned char)line[bg + i + 1])) ) return 1;
sscanf((char[]){line[bg + i], line[bg + i + 1], 0}, "%X", &temp);
data[i / 2] = temp & 0xff;
sscanf((char[]){line[bg + i], line[bg + i + 1], 0}, "%X", &temp);
data[i / 2] = temp & 0xff;
- if (isxdigit(line[indx])) {
+ if (isxdigit((unsigned char)line[indx])) {
buf[strlen(buf) + 1] = 0x00;
buf[strlen(buf)] = line[indx];
} else {
buf[strlen(buf) + 1] = 0x00;
buf[strlen(buf)] = line[indx];
} else {
else if (x >= 'A' && x <= 'F')
x -= 'A' - 10;
else {
else if (x >= 'A' && x <= 'F')
x -= 'A' - 10;
else {
- printf("Discovered unknown character %c %d at idx %d of %s\n", x, x, source - start, start);
+ printf("Discovered unknown character %c %d at idx %tu of %s\n", x, x, source - start, start);