aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-09-10 22:45:12 +0200
committerToni Uhlig <matzeton@googlemail.com>2022-09-10 22:45:12 +0200
commita992c79ab6bcf352cd88f5d7383e5c9fa091f489 (patch)
tree20c5c217a84b72bd0e2858a98a96ada3138d2f9a
parent6fe5d1da6979782955902b01f54a8bc9cf7b826b (diff)
Fixed compilation warnings on linux32 platforms.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--nDPId-test.c12
-rw-r--r--nDPId.c6
2 files changed, 13 insertions, 5 deletions
diff --git a/nDPId-test.c b/nDPId-test.c
index 48cf6e003..c3db6283d 100644
--- a/nDPId-test.c
+++ b/nDPId-test.c
@@ -1076,8 +1076,16 @@ int main(int argc, char ** argv)
nDPId_return.total_active_flows != nDPId_return.total_idle_flows)
{
logger(1, "%s: %s", argv[0], "Memory / Flow leak detected.");
- logger(1, "%s: Allocated / Free'd bytes: %lu / %lu", argv[0], ndpi_memory_alloc_bytes, ndpi_memory_free_bytes);
- logger(1, "%s: Allocated / Free'd count: %lu / %lu", argv[0], ndpi_memory_alloc_count, ndpi_memory_free_count);
+ logger(1,
+ "%s: Allocated / Free'd bytes: %llu / %llu",
+ argv[0],
+ (unsigned long long int)ndpi_memory_alloc_bytes,
+ (unsigned long long int)ndpi_memory_free_bytes);
+ logger(1,
+ "%s: Allocated / Free'd count: %llu / %llu",
+ argv[0],
+ (unsigned long long int)ndpi_memory_alloc_count,
+ (unsigned long long int)ndpi_memory_free_count);
logger(1,
"%s: Total Active / Idle Flows: %llu / %llu",
argv[0],
diff --git a/nDPId.c b/nDPId.c
index d7482ad66..69b067c0b 100644
--- a/nDPId.c
+++ b/nDPId.c
@@ -2101,15 +2101,15 @@ static void send_to_collector(struct nDPId_reader_thread * const reader_thread,
}
else if (collector_address.raw.sa_family == AF_UNIX)
{
- off_t pos = (written < 0 ? 0 : written);
+ size_t pos = (written < 0 ? 0 : written);
logger(0,
- "[%8llu, %zu] Send less data then expected (%zd < %d bytes), falling back to blocking I/O",
+ "[%8llu, %zu] Send less data then expected (%zu < %d bytes), falling back to blocking I/O",
workflow->packets_captured,
reader_thread->array_index,
pos,
s_ret);
set_collector_block(reader_thread);
- while ((written = write(reader_thread->collector_sockfd, newline_json_str + pos, s_ret - pos)) !=
+ while ((size_t)(written = write(reader_thread->collector_sockfd, newline_json_str + pos, s_ret - pos)) !=
s_ret - pos)
{
saved_errno = errno;