Fix unit test utility to get it working with t:removeNulls

This commit is contained in:
Felipe Zimmerle
2015-10-21 16:05:07 -03:00
parent 17faef565e
commit 3d2ec2a3f5
2 changed files with 8 additions and 8 deletions

View File

@@ -26,7 +26,7 @@
#include "modsecurity/assay.h"
#include "actions/transformations/transformation.h"
#include "src/utils.h"
namespace ModSecurity {
namespace actions {
@@ -37,17 +37,16 @@ std::string RemoveNulls::evaluate(std::string value,
Assay *assay) {
int64_t i;
std::string ret;
i = 0;
while (i < value.size()) {
if (value.at(i) != '\0') {
ret += value.at(i);
if (value.at(i) == '\0') {
value.erase(i, 1);
} else {
i++;
}
i++;
}
return ret;
return value;
}