> Attached is a first shot at seq(1) for sbase. I do not like having to
> juggle data around to play games with sprintf, so if someone has a
> cleaner approach to this program, please speak up.
Unfortunately, there isn't much that can be done. User input is always
sub-par, and unless we want to account for scientific notation, or trailing
zeros, the easiest thing is to let atof parse the input, and then have
sprintf provide us a sane string.
I've cleaned up the code a bit, moved the digit-counting into separate
functions, and added simple regexp.h format string validation. I realizr
- text/x-csrc attachment: seq.c
Received on Mon Apr 16 2012 - 09:45:46 CEST