aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2019-07-06 01:49:50 +0200
committerToni Uhlig <matzeton@googlemail.com>2019-07-06 01:49:50 +0200
commitd42cd7795a44d5e5c32432eb536ef525bdb359a8 (patch)
tree27393ef27b1c250fbf1ac5e041e20549d3548a05
parentc64928e8e0211edf2ccfa628dfa41e5bd62ef8ae (diff)
use arc4random() for coverity builds, yet another format specifier fix
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--src/pkt.c4
-rw-r--r--src/utils.c2
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)