aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 86d0723e5..9840d8715 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -4718,9 +4718,13 @@ char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod,
ndpi_protocol proto, char *buf, u_int buf_len) {
if((proto.master_protocol != NDPI_PROTOCOL_UNKNOWN)
&& (proto.master_protocol != proto.app_protocol)) {
- snprintf(buf, buf_len, "%s.%s",
- ndpi_get_proto_name(ndpi_mod, proto.master_protocol),
- ndpi_get_proto_name(ndpi_mod, proto.app_protocol));
+ if(proto.app_protocol != NDPI_PROTOCOL_UNKNOWN)
+ snprintf(buf, buf_len, "%s.%s",
+ ndpi_get_proto_name(ndpi_mod, proto.master_protocol),
+ ndpi_get_proto_name(ndpi_mod, proto.app_protocol));
+ else
+ snprintf(buf, buf_len, "%s",
+ ndpi_get_proto_name(ndpi_mod, proto.master_protocol));
} else
snprintf(buf, buf_len, "%s",
ndpi_get_proto_name(ndpi_mod, proto.app_protocol));