#include "util.h"
#include <stdint.h>
+#include <inttypes.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
error += tcsetattr(STDIN_FILENO, TCSANOW, &Otty); // reset attributes
}
- return ( error == 0 ? cnt : -1 );
+ return cnt;
}
char getch(void)
}
if (strlen(buf) >= 2) {
- sscanf(buf, "%x", &temp);
+ sscanf(buf, "%" SCNx32, &temp);
data[*datalen] = (uint8_t)(temp & 0xff);
*buf = 0;
(*datalen)++;