working -u -l -c

This commit is contained in:
elvis
2022-04-30 00:37:59 +02:00
parent 6bf73e8d18
commit 85231d073f
6 changed files with 11 additions and 10 deletions

View File

@ -838,9 +838,9 @@ int cmd_u(char *filelist, int print) {
}
// we copy filelist because we are nice
char *tofree = malloc(strnlen(filelist, MAXARGLENGTH)+1);
char *tofree = calloc(strnlen(filelist, MAXARGLENGTH)+1, sizeof(char));
if(!tofree) {
perror("malloc");
perror("calloc");
return -1;
}
strncpy(tofree, filelist, strnlen(filelist, MAXARGLENGTH));
@ -884,9 +884,9 @@ int cmd_c(char *filelist, int print) {
}
// we copy filelist because we are nice
char *tofree = malloc(strnlen(filelist, MAXARGLENGTH)+1);
char *tofree = calloc(strnlen(filelist, MAXARGLENGTH)+1, sizeof(char));
if(!tofree) {
perror("malloc");
perror("calloc");
return -1;
}
strncpy(tofree, filelist, strnlen(filelist, MAXARGLENGTH));