content: fix -Wshadow warning

pull/2432/head
Victor Julien 9 years ago
parent 02df79f67b
commit d50b4b8471

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

Loading…
Cancel
Save