fixed bug when description contains special chars
authorJean-Philippe Orsini <jeanfi@gmail.com>
Wed, 27 Nov 2013 07:31:16 +0000 (07:31 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Wed, 27 Nov 2013 07:31:16 +0000 (07:31 +0000)
src/tw.c

index cbf3d61..926a039 100644 (file)
--- a/src/tw.c
+++ b/src/tw.c
@@ -234,22 +234,18 @@ static char *escape(const char *txt)
 
 void tw_modify_description(const char *uuid, const char *newdesc)
 {
-       char *str;
        char *opts;
 
-       str = escape(newdesc);
-
        opts = malloc(1
                      + strlen(uuid)
                      + strlen(" modify :\"")
-                     + strlen(str)
+                     + strlen(newdesc)
                      + strlen("\"")
                      + 1);
-       sprintf(opts, " %s modify \"%s\"", uuid, str);
+       sprintf(opts, " %s modify \"%s\"", uuid, newdesc);
 
        tw_exec(opts);
 
-       free(str);
        free(opts);
 }