X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/1ca5dce0f4d297d739010ca5fc5954683fa3ec1a..6fe5fe8d521821b6d9615d9c77031097c94ef50e:/client/util.c diff --git a/client/util.c b/client/util.c index 3a7cbac4..f70b5aed 100644 --- a/client/util.c +++ b/client/util.c @@ -12,6 +12,8 @@ #define MAX_BIN_BREAK_LENGTH (3072+384+1) #ifndef _WIN32 +#include + int ukbhit(void) { int cnt = 0; int error; @@ -185,7 +187,7 @@ char *sprint_hex_ascii(const uint8_t *data, const size_t len) { void num_to_bytes(uint64_t n, size_t len, uint8_t* dest) { while (len--) { - dest[len] = (uint8_t) n; + dest[len] = n & 0xFF; n >>= 8; } }