Fixed compilation warnings on linux32 platforms.

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2022-09-10 22:45:12 +02:00
parent 6fe5d1da69
commit a992c79ab6
2 changed files with 13 additions and 5 deletions

View File

@@ -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],

View File

@@ -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;