In comp.sys.raspberry-pi, A. Dumas wrote:
> Eli the Bearded wrote:
>> I basically completely rewrote slowcat.c today:
>> https://gist.github.com/Eli-the-Bearded/162ad5989cc5b95c4b18758dd9da0780
> Great work. For the user that's trying to be difficult there might be an
> unexpected unsigned to signed conversion: an argument >LONG_MAX will
> trigger the <75 test because you use strtoul but store the result in a
> (signed) long variable. Of course the test for upper *and* lower bound
> guarantees functionality in some way, so, no biggie.
Yeah, I'm more focused on keeping it in range than exactly matching the
user's input. If they think results seem odd, turn on the verbose mode
and see what happened.
> Also, but I am not at all sure because I didn't know getopt (a glaring
> omission in my C knowledge) and only just looked it up, but it seems like
> opterr must be set to zero if you want to avoid default error messages.
I rarely use getopt(), and usually go for getopt_long(), but I'm not
expert in either. I skipped getopt_long() here because I believe
getopt() is a lot more portable. I seem to recall I needed to #ifdef
some include files on one of the BSDs last time I tried it.
I'll probably make a proper repo, and include animations, sometime this
weekend. I'll look into testing more edge cases then.
Elijah
------
too bad the video copyrights are so murky
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|