B
Ben Bacarisse
Nick said:True, thanks. As has been said many times before, catching all errors
is complicated, even with strtol to help.
Practically, I think that's the least of the problems
here: and limiting the number of dice that generated to LONG_MAX-1 isn't
going to reduce the utility of the program that much.
I agree, but that is not what is happening (yet). strtol is used only
to find two numbers to add (truly bizarre, but I don't want to try to
find out why this is done).
If, later, the program were to use strtol to find the upper limit of
the dice roll, then a bunch of other problems spring up, not least the
fact the RAND_MAX may be a lot smaller than LONG_MAX.