diff --git a/src/common/unaccent.cpp b/src/common/unaccent.cpp index 0bb8ddf02..a504ef5a6 100644 --- a/src/common/unaccent.cpp +++ b/src/common/unaccent.cpp @@ -4,7 +4,7 @@ using namespace std; /* Remove accent */ std::string removeAccents(const char *text = NULL) { - char* out = 0; + char* out = NULL; size_t out_length = 0; if (!unac_string("UTF8", text, strlen(text), &out, &out_length)) { @@ -12,7 +12,9 @@ std::string removeAccents(const char *text = NULL) { textWithoutAccent = string(out, out_length); free(out); return textWithoutAccent; - } if (text != NULL) { + } + + if (text != NULL) { return string(text); } diff --git a/src/common/unaccent.h b/src/common/unaccent.h index 9818286c8..418f42833 100644 --- a/src/common/unaccent.h +++ b/src/common/unaccent.h @@ -3,5 +3,6 @@ #include #include #include +#include std::string removeAccents(const char *text);