Avoid negative array indices: an empty string can also be used

to specify a default value.
This commit is contained in:
Diomidis Spinellis 2006-11-06 11:03:43 +00:00
parent 1ab8c5be60
commit fee14f30e9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164028
2 changed files with 3 additions and 2 deletions

View file

@ -106,7 +106,8 @@ and the step size or, for random data, the seed.
While at least one of them must appear,
any of the other three may be omitted, and
will be considered as such if given as
.Fl "" .
.Fl ""
or as an empty string.
Any three of these arguments determines the fourth.
If four are specified and the given and computed values of
.Ar reps

View file

@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$");
#define HAVE_BEGIN 4
#define HAVE_REPS 8
#define is_default(s) (strcmp((s), "-") == 0)
#define is_default(s) (*(s) == 0 || strcmp((s), "-") == 0)
double begin;
double ender;