From: roel@libnfc.org Date: Thu, 28 Feb 2013 22:46:49 +0000 (+0000) Subject: fixed stupid 64-bit formatting for x86/amd64 and unix/windows - part3 X-Git-Tag: v1.0.0~130^2~8 X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/a0bbdb76ca0e8bc822b079ab0c400f88bdca68cd?ds=sidebyside;hp=1a07fd510d6b4c9267b589123143236458c8f9ea fixed stupid 64-bit formatting for x86/amd64 and unix/windows - part3 --- diff --git a/client/cmdhfepa.c b/client/cmdhfepa.c index 6588c393..a89c448a 100644 --- a/client/cmdhfepa.c +++ b/client/cmdhfepa.c @@ -25,13 +25,13 @@ static int CmdHelp(const char *Cmd); int CmdHFEPACollectPACENonces(const char *Cmd) { // requested nonce size - uint8_t m = 0; + unsigned int m = 0; // requested number of Nonces unsigned int n = 0; // delay between requests unsigned int d = 0; - sscanf(Cmd, "%"hhu" %u %u", &m, &n, &d); + sscanf(Cmd, "%u %u %u", &m, &n, &d); // values are expected to be > 0 m = m > 0 ? m : 1; diff --git a/client/uart.c b/client/uart.c index e4da1951..75a15b2e 100644 --- a/client/uart.c +++ b/client/uart.c @@ -282,6 +282,15 @@ typedef struct { COMMTIMEOUTS ct; // Serial port time-out configuration } serial_port_windows; +void upcase(char *p) { + while(*p != '\0') { + if(*p >= 97 && *p <= 122) { + *p -= 32; + } + ++p; + } +} + serial_port uart_open(const char* pcPortName) { char acPortName[255]; @@ -289,7 +298,7 @@ serial_port uart_open(const char* pcPortName) // Copy the input "com?" to "\\.\COM?" format sprintf(acPortName,"\\\\.\\%s",pcPortName); - _strupr(acPortName); + upcase(acPortName); // Try to open the serial port sp->hPort = CreateFileA(acPortName,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);