aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2023-08-01 15:35:33 +0200
committerLuca Deri <deri@ntop.org>2023-08-01 15:35:33 +0200
commit196395398ebdeb47e0da102f7bb489b355f63ae2 (patch)
treec9ce68bbf6d090b6379c5c184d7a1177ac974ac9 /example/reader_util.c
parente4d3d619bc9fa2e38521b7ced17f4e7aa633d812 (diff)
Compilation fixes for older C compilers
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index a70390d9c..268f87ed1 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -1200,15 +1200,20 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
}
/* SERVICE_LOCATION */
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_SERVICE_LOCATION)) {
+ size_t i;
+
flow->info_type = INFO_GENERIC;
flow->info[0] = 0;
if (flow->ndpi_flow->protos.slp.url_count > 0)
strncat(flow->info, "URL(s): ", sizeof(flow->info));
- for (size_t i = 0; i < flow->ndpi_flow->protos.slp.url_count; ++i) {
+
+ for (i = 0; i < flow->ndpi_flow->protos.slp.url_count; ++i) {
size_t length = strlen(flow->info);
+
strncat(flow->info + length, flow->ndpi_flow->protos.slp.url[i],
sizeof(flow->info) - length);
length = strlen(flow->info);
+
if (i < (size_t)flow->ndpi_flow->protos.slp.url_count - 1)
strncat(flow->info + length, ", ", sizeof(flow->info) - length);
}