From d42cd7795a44d5e5c32432eb536ef525bdb359a8 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Sat, 6 Jul 2019 01:49:50 +0200 Subject: use arc4random() for coverity builds, yet another format specifier fix Signed-off-by: Toni Uhlig --- src/pkt.c | 4 ++-- src/utils.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pkt.c b/src/pkt.c index 473737e..bc87720 100644 --- a/src/pkt.c +++ b/src/pkt.c @@ -218,8 +218,8 @@ void handle_packet(char *buf, unsigned bytes, int is_pcap, struct sockaddr_in *a if (pt_pkt->data_len != sizeof(challenge_t)) { pt_log(kLog_error, "Received challenge packet, but data length " "is not as expected.\n"); - pt_log(kLog_debug, "Data length: %d Expected: %d\n", - pt_pkt->data_len, sizeof (challenge_t)); + pt_log(kLog_debug, "Data length: %u Expected: %lu\n", + pt_pkt->data_len, sizeof(challenge_t)); cur->should_remove = 1; return; } diff --git a/src/utils.c b/src/utils.c index 8e340d4..64f6f88 100644 --- a/src/utils.c +++ b/src/utils.c @@ -157,7 +157,7 @@ void print_hexstr(unsigned char *buf, size_t siz) { #endif int pt_random(void) { -#ifdef HAVE_ARC4RANDOM +#if defined(HAVE_ARC4RANDOM) || defined(__COVERITY__) return arc4random(); #else #if defined(RNGDEV) && !defined(_WIN32) -- cgit v1.2.3