Skip to content

Commit

Permalink
Merge pull request #146 from bwarden/patch-1
Browse files Browse the repository at this point in the history
Accept -j arguments greater than FSA_MAX_COMPJOBS
  • Loading branch information
fdupoux authored Jan 27, 2024
2 parents 03089f4 + b306a0e commit a6900a6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/fsarchiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,17 @@ int process_cmdline(int argc, char **argv)
break;
case 'j': // compression jobs
g_options.compressjobs=atoi(optarg);
if (g_options.compressjobs<1 || g_options.compressjobs>FSA_MAX_COMPJOBS)
if (g_options.compressjobs<1)
{
errprintf("[%s] is not a valid number of jobs. Must be between 1 and %d\n", optarg, FSA_MAX_COMPJOBS);
errprintf("[%s] is not a valid number of jobs. Must be at least 1\n", optarg);
usage(progname, false);
return 1;
}
if (g_options.compressjobs>FSA_MAX_COMPJOBS)
{
g_options.compressjobs = FSA_MAX_COMPJOBS;
msgprintf(MSG_FORCE, "[%s] is greater than the maximum number of jobs. Limiting to %d.\n", optarg, FSA_MAX_COMPJOBS);
}
break;
case 'e': // exclude files/directories
strlist_add(&g_options.exclude, optarg);
Expand Down

0 comments on commit a6900a6

Please sign in to comment.