mirror of https://github.com/xfarrow/dircomp.git
String length error
This commit is contained in:
parent
665f8f7b9c
commit
6eaf0de2ee
|
@ -19,8 +19,8 @@ int main(int argc, char *argv[])
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* directory_to_analyze1 = malloc(strlen(arguments.directory1) * sizeof(char));
|
char* directory_to_analyze1 = malloc(strlen(arguments.directory1) * sizeof(char) + 1);
|
||||||
char* directory_to_analyze2 = malloc(strlen(arguments.directory2) * sizeof(char));
|
char* directory_to_analyze2 = malloc(strlen(arguments.directory2) * sizeof(char) + 1);
|
||||||
strcpy(directory_to_analyze1, arguments.directory1);
|
strcpy(directory_to_analyze1, arguments.directory1);
|
||||||
strcpy(directory_to_analyze2, arguments.directory2);
|
strcpy(directory_to_analyze2, arguments.directory2);
|
||||||
free(arguments.directory1);
|
free(arguments.directory1);
|
||||||
|
|
Loading…
Reference in New Issue