From d98060410cec5fd1793a6eca056cc53577033630 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Fri, 16 Jan 2015 10:12:55 +0100 Subject: [PATCH] list keywords: restore 2.0 similar output Unset was previously displayed if the application layer was not set. Code before this patch was displaying '(null)' which is not user friendly. --- src/detect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detect.c b/src/detect.c index ad0af28c8a..648c69ef7e 100644 --- a/src/detect.c +++ b/src/detect.c @@ -4902,8 +4902,8 @@ static inline void SigMultilinePrint(int i, char *prefix) void SigTableList(const char *keyword) { size_t size = sizeof(sigmatch_table) / sizeof(SigTableElmt); - size_t i; + char *proto_name; if (keyword == NULL) { printf("=====Supported keywords=====\n"); @@ -4928,8 +4928,8 @@ void SigTableList(const char *keyword) printf("%s", sigmatch_table[i].desc); } /* Build feature */ - printf(";%s;", - AppLayerGetProtoName(sigmatch_table[i].alproto)); + proto_name = AppLayerGetProtoName(sigmatch_table[i].alproto); + printf(";%s;", proto_name ? proto_name : "Unset"); PrintFeatureList(sigmatch_table[i].flags, ':'); printf(";"); if (sigmatch_table[i].url) {