This functionality is present in GNU base64 and I find it useful when I want to generate random, ASCII-clean data of specific width.
Unit Tests Skipped
It looks like the only reason that arg_to_col exists was to parse the -w argument, and what it does was to strtol(), then perform sanity check of the returned value.
Instead of having a separate function, it would make the code more readable to just use strtol() here with the intermediate _long variable to hold the value, then perform the range check of the returned value and give the feedback here, unless there is plan to have the function used in somewhere else...
Mind adding a comment the reasoning of why 1023 was chosen here? If it was rounddown(BUFSIZE, 3), is it possible to represent that way?
Did you mean optarg_long here? (If so, that would be another reason to just fold the function back into the getopt_long loop...)
Hi, thanks for the review!
Good point, I'll recall what the idea was and describe it here.
Good point, I'll use optarg_long here.