Removed strcpy calls

This commit is contained in:
James Booth
2014-04-02 21:01:20 +01:00
parent e1db531875
commit a720ef2627
8 changed files with 31 additions and 34 deletions

View File

@@ -1169,7 +1169,6 @@ cmd_autocomplete(char *input, int *size)
{
int i = 0;
char *found = NULL;
char *auto_msg = NULL;
char inp_cpy[*size];
// autocomplete command
@@ -1180,8 +1179,7 @@ cmd_autocomplete(char *input, int *size)
inp_cpy[i] = '\0';
found = autocomplete_complete(commands_ac, inp_cpy);
if (found != NULL) {
auto_msg = (char *) malloc(strlen(found) + 1);
strcpy(auto_msg, found);
char *auto_msg = strdup(found);
inp_replace_input(input, auto_msg, size);
free(auto_msg);
free(found);