zehortigoza pushed a commit to branch master.

commit 9b9002e7e379dc4440ac7544bd2c177c9cf16041
Author: José Roberto de Souza <[email protected]>
Date:   Mon Jul 8 13:42:18 2013 -0300

    eldbus-codegen: If substr dont exist in string return string.
    
    CID: 1039339
---
 src/bin/eldbus/utils.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/bin/eldbus/utils.c b/src/bin/eldbus/utils.c
index a020445..de4eb15 100644
--- a/src/bin/eldbus/utils.c
+++ b/src/bin/eldbus/utils.c
@@ -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)))

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to