From 55ab112e77819bcd715088e0064b988bc6487f09 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 22 Mar 2019 20:34:06 +0100 Subject: [PATCH] app-layer/pd: minor code cleanup --- src/app-layer-detect-proto.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 9add685f69..afd4ee83d6 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -1099,18 +1099,13 @@ static void AppLayerProtoDetectPMGetIpprotos(AppProto alproto, { SCEnter(); - const AppLayerProtoDetectPMSignature *s = NULL; - int i, j; - uint8_t ipproto; - - for (i = 0; i < FLOW_PROTO_DEFAULT; i++) { - ipproto = FlowGetReverseProtoMapping(i); - for (j = 0; j < 2; j++) { + for (int i = 0; i < FLOW_PROTO_DEFAULT; i++) { + uint8_t ipproto = FlowGetReverseProtoMapping(i); + for (int j = 0; j < 2; j++) { AppLayerProtoDetectPMCtx *pm_ctx = &alpd_ctx.ctx_ipp[i].ctx_pm[j]; - SigIntId x; - for (x = 0; x < pm_ctx->max_sig_id;x++) { - s = pm_ctx->map[x]; + for (SigIntId x = 0; x < pm_ctx->max_sig_id; x++) { + const AppLayerProtoDetectPMSignature *s = pm_ctx->map[x]; if (s->alproto == alproto) ipprotos[ipproto / 8] |= 1 << (ipproto % 8); }