Fix compilation warnings

Ths call to nanosleep was missing it's header and the length
calculation in parse_cred_mgmt_subcommandparams could be wrong when
compiled for 64-bit targets. Both of these showed up as compiler
warnings.
pull/540/head
Tom Thorogood 2021-03-12 20:08:19 +10:30 zatwierdzone przez Conor Patrick
rodzic 5a0dee03d2
commit c1540afe77
2 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -1064,7 +1064,7 @@ static uint8_t parse_cred_mgmt_subcommandparams(CborValue * val, CTAP_credMgmt *
const uint8_t * end_byte = cbor_value_get_next_byte(&map);
uint32_t length = (uint32_t)end_byte - (uint32_t)start_byte;
uint32_t length = (uint32_t)(end_byte - start_byte);
if (length > sizeof(CM->hashed.subCommandParamsCborCopy))
{
return CTAP2_ERR_LIMIT_EXCEEDED;

Wyświetl plik

@ -15,6 +15,7 @@
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <time.h>
#include "device.h"
#include "cbor.h"