} else if (argv[i][1] == 'j') {
workers = atoi(argv[i + 1]);
i++;
If the last argument is "-j6" then this will read past the end of the allocated argv strings and try to do atoi(NULL): % ./bzip3 -j3 < README.md
Segmentation fault
"-j6" is standard getopt() behavior, and the default expected behavior from Unix/POSIX systems.