Code cosmetics: reduce the amount of cppcheck warnings

This commit is contained in:
Felipe Zimmerle
2015-08-12 15:22:00 -03:00
parent 21400ba454
commit d5fe21ce3c
24 changed files with 49 additions and 56 deletions

View File

@@ -31,7 +31,7 @@ SetVar::SetVar(std::string action)
bool SetVar::init(std::string *error) {
size_t pos = std::string::npos;
size_t pos;
// Resolv operation
operation = setToOne;

View File

@@ -37,7 +37,7 @@ namespace transformations {
std::string CssDecode::evaluate(std::string value,
Assay *assay) {
char *tmp = strdup(value.c_str());
int res = css_decode_inplace((unsigned char *)tmp, value.size());
css_decode_inplace((unsigned char *)tmp, value.size());
std::string ret(tmp, 0, value.size());
free(tmp);
return ret;

View File

@@ -37,7 +37,7 @@ namespace transformations {
std::string HtmlEntityDecode::evaluate(std::string value,
Assay *assay) {
char *tmp = strdup(value.c_str());
int res = html_entities_decode_inplace((unsigned char *)tmp, value.size());
html_entities_decode_inplace((unsigned char *)tmp, value.size());
std::string ret("");
ret.assign(tmp);
free(tmp);

View File

@@ -37,7 +37,7 @@ namespace transformations {
std::string JsDecode::evaluate(std::string value,
Assay *assay) {
char *tmp = strdup(value.c_str());
int res = js_decode_nonstrict_inplace((unsigned char *)tmp, value.size());
js_decode_nonstrict_inplace((unsigned char *)tmp, value.size());
std::string ret("");
ret.assign(tmp);
free(tmp);

View File

@@ -38,7 +38,7 @@ std::string NormalisePathWin::evaluate(std::string value,
Assay *assay) {
int changed;
char *tmp = strdup(value.c_str());
int res = normalize_path_inplace((unsigned char *)tmp,
normalize_path_inplace((unsigned char *)tmp,
value.size(), 1, &changed);
std::string ret("");
ret.assign(tmp);

View File

@@ -38,7 +38,7 @@ std::string UrlDecodeUni::evaluate(std::string value,
Assay *assay) {
int changed = 0;
char *tmp = strdup(value.c_str());
int res = urldecode_uni_nonstrict_inplace_ex(assay, (unsigned char *)tmp,
urldecode_uni_nonstrict_inplace_ex(assay, (unsigned char *)tmp,
value.size(), &changed);
std::string ret("");
ret.assign(tmp);