]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
content: fix -Wshadow warning
authorVictor Julien <victor@inliniac.net>
Mon, 28 Nov 2016 08:59:05 +0000 (09:59 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 28 Nov 2016 12:55:19 +0000 (13:55 +0100)
src/detect-content.c

index a62b4e274bdf0bfc3b186df4e4b20b197421c0ba..9b990a94051280cb9e54befe3cfa6d111ebc0015 100644 (file)
@@ -291,8 +291,7 @@ void DetectContentPrint(DetectContentData *cd)
         SCLogDebug("DetectContentData \"cd\" is NULL");
         return;
     }
-    char *tmpstr=SCMalloc(sizeof(char) * cd->content_len + 1);
-
+    char *tmpstr = SCMalloc(sizeof(char) * cd->content_len + 1);
     if (tmpstr != NULL) {
         for (i = 0; i < cd->content_len; i++) {
             if (isprint(cd->content[i]))
@@ -318,19 +317,20 @@ void DetectContentPrint(DetectContentData *cd)
     SCLogDebug("flags: %u ", cd->flags);
     SCLogDebug("negated: %s ", cd->flags & DETECT_CONTENT_NEGATED ? "true" : "false");
     SCLogDebug("relative match next: %s ", cd->flags & DETECT_CONTENT_RELATIVE_NEXT ? "true" : "false");
+
     if (cd->replace && cd->replace_len) {
-        char *tmpstr=SCMalloc(sizeof(char) * cd->replace_len + 1);
+        char *tmprstr = SCMalloc(sizeof(char) * cd->replace_len + 1);
 
-        if (tmpstr != NULL) {
+        if (tmprstr != NULL) {
             for (i = 0; i < cd->replace_len; i++) {
                 if (isprint(cd->replace[i]))
-                    tmpstr[i] = cd->replace[i];
+                    tmprstr[i] = cd->replace[i];
                 else
-                    tmpstr[i] = '.';
+                    tmprstr[i] = '.';
             }
-            tmpstr[i] = '\0';
-            SCLogDebug("Replace: \"%s\"", tmpstr);
-            SCFree(tmpstr);
+            tmprstr[i] = '\0';
+            SCLogDebug("Replace: \"%s\"", tmprstr);
+            SCFree(tmprstr);
         } else {
             SCLogDebug("Replace: ");
             for (i = 0; i < cd->replace_len; i++)