Skip to content

Commit

Permalink
fix, be strict in dateset --isvalid when input formats are present, f…
Browse files Browse the repository at this point in the history
…ixes issue #146
  • Loading branch information
hroptatyr committed Jul 29, 2022
1 parent 042ae17 commit 117d1f5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/dtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,12 @@ main(int argc, char *argv[])

if (argi->isvalid_flag) {
/* check that one date */
res = 1;
for (size_t i = 0; i < nifmt; i++) {
char *ep = NULL;
char *ep = NULL;

res = nifmt > 0U ||
dt_unk_p(dt_strpdt(*argi->args, NULL, &ep)) ||
ep == NULL || *ep;
for (size_t i = 0; i < nifmt; i++, ep = NULL) {
if (!dt_unk_p(dt_strpdt(*argi->args, ifmt[i], &ep)) &&
ep && !*ep) {
res = 0;
Expand Down

0 comments on commit 117d1f5

Please sign in to comment.