Browse code

simplified a string duplication

Kevin Lin authored on 2015/02/21 07:00:48
Showing 1 changed files
... ...
@@ -182,10 +182,9 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex
182 182
         char *start, *end;
183 183
 
184 184
         /* get copied */
185
-        hexcpy = cli_calloc(hexlen+1, sizeof(char));
185
+        hexcpy = cli_strdup(hexsig);
186 186
         if(!hexcpy)
187 187
             return CL_EMEM;
188
-        strncpy(hexcpy, hexsig, hexlen);
189 188
 
190 189
         /* get delimiters-ed */
191 190
         start = strchr(hexcpy, '/');