eldbus-codegen: If substr dont exist in string return string.

CID: 1039339
This commit is contained in:
José Roberto de Souza 2013-07-08 13:42:18 -03:00
parent 353de50898
commit 9b9002e7e3
1 changed files with 5 additions and 0 deletions

View File

@ -87,6 +87,11 @@ replace_string(const char *string, const char *substr, const char *replacement)
Eina_Strbuf *buffer = eina_strbuf_new();
pch = strtok(str_cpy, substr);
if (!pch)
{
eina_strbuf_free(buffer);
return str_cpy;
}
eina_strbuf_append(buffer, pch);
while ((pch = strtok(NULL, substr)))