fixed -r and -d

This commit is contained in:
elvis
2022-04-29 15:47:27 +02:00
parent b0b9310acc
commit 6a7b018f25
3 changed files with 11 additions and 9 deletions

View File

@ -397,7 +397,7 @@ int readFile(const char* pathname, void** buf, size_t* size) {
fflush(openedFiles->out);
}
if(storeFilesInDirectory(openedFiles->rDir, 1, res->rf) == -1) {
perror("storeFilesindirectory");
perror("storeFilesInDirectory");
freeResponse(res);
free(res);
free(cmd);
@ -1442,7 +1442,7 @@ _nofile:
}
int storeFilesInDirectory(const char *dirname, int n, recivedFile_t *rf) {
if(!dirname || strcmp(dirname, "") || !rf || n<0) {
if(!dirname || strcmp(dirname, "")==0 || !rf || n<0) {
errno = EINVAL;
return -1;
}