aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-12-09 15:28:44 +0100
committerLuca Deri <deri@ntop.org>2019-12-09 15:28:44 +0100
commit65d526d8f6ae75f8d1a3f5c8dd19bf40ec03f320 (patch)
treed6fa58447b77245af6f616f2026acceff6ecd08b /example/ndpiReader.c
parent56eeb965bf82fd9fbcd7a2b340cbf9473abaab20 (diff)
Code cleanup
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index cb40166c8..698f42dbf 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -1995,7 +1995,7 @@ static void printFlowsStats() {
ndpi_ja3_info *tmp2 = NULL;
unsigned int num_ja3_client;
unsigned int num_ja3_server;
-
+
fprintf(out, "\n");
num_flows = 0;
@@ -2164,7 +2164,7 @@ static void printFlowsStats() {
num_ja3_server = HASH_COUNT(ja3ByHost_element->host_server_info_hasht);
if(num_ja3_client > 0) {
- fprintf(out, "\t%d\t %-24s \t %-7d\n",
+ fprintf(out, "\t%d\t %-24s \t %-7u\n",
i,
ja3ByHost_element->ip_string,
num_ja3_client
@@ -2985,9 +2985,9 @@ void test_lib() {
/* *********************************************** */
void automataUnitTest() {
- void *automa;
+ void *automa = ndpi_init_automa();
- assert((automa = ndpi_init_automa()));
+ assert(automa);
assert(ndpi_add_string_to_automa(automa, "hello") == 0);
assert(ndpi_add_string_to_automa(automa, "world") == 0);
ndpi_finalize_automa(automa);
@@ -3008,8 +3008,8 @@ void serializerUnitTest() {
char kbuf[32], vbuf[32];
assert(ndpi_serialize_uint32_uint32(&serializer, i, i*i) != -1);
- snprintf(kbuf, sizeof(kbuf), "Hello %u", i);
- snprintf(vbuf, sizeof(vbuf), "World %u", i);
+ snprintf(kbuf, sizeof(kbuf), "Hello %d", i);
+ snprintf(vbuf, sizeof(vbuf), "World %d", i);
assert(ndpi_serialize_uint32_string(&serializer, i, "Hello") != -1);
assert(ndpi_serialize_string_string(&serializer, kbuf, vbuf) != -1);
assert(ndpi_serialize_string_uint32(&serializer, kbuf, i*i) != -1);