|
@@ -386,8 +386,8 @@ int set_redirection(Command* c){
|
|
|
buffer++;
|
|
|
}
|
|
|
//Allocation file et copie nom fichier
|
|
|
- file = malloc(sizeof(char) * compteur);
|
|
|
- memset(file, 0, compteur);
|
|
|
+ file = malloc(sizeof(char) * (compteur + 1));
|
|
|
+ memset(file, 0, compteur + 1);
|
|
|
strncpy(file, deb, compteur);
|
|
|
//Redirection
|
|
|
if(set_io(c, file, redir) == SHELL_ERR){
|