From: Victor Julien Date: Fri, 22 Mar 2019 19:34:06 +0000 (+0100) Subject: app-layer/pd: minor code cleanup X-Git-Tag: suricata-5.0.0-beta1~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55ab112e77819bcd715088e0064b988bc6487f09;p=thirdparty%2Fsuricata.git app-layer/pd: minor code cleanup --- 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); }