This functionality is present in GNU base64 and I find it useful when I want to generate random, ASCII-clean data of specific width.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
usr.bin/uuencode/uuencode.c | ||
---|---|---|
106 ↗ | (On Diff #104241) | 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... |
159 ↗ | (On Diff #104241) | 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? |
254 ↗ | (On Diff #104241) | Did you mean optarg_long here? (If so, that would be another reason to just fold the function back into the getopt_long loop...) |
Minor style nit, otherwise looks fine.
usr.bin/uuencode/uuencode.c | ||
---|---|---|
243–244 ↗ | (On Diff #105059) | style |