Hi Sören Yes maybe code needs a rewrite, but I remember to have tested it against a full year of dates and it looked correct. With the logical AND code is testing an integer value ( months shifted by the value of D ) which will always result in a > 0 value, which will always be considered true, so the second test is ineffective until December. With bitwise AND the same value is ANDed with a 0/1 from the second condition, so it will get true/false on the right months, hopefully Regards On Sun, Nov...
Some modifications I made to get it compile under GCC-10 with defaults $ LC_ALL=C TZ=UTC0 diff -Naur stroke-0.1.3 stroke-0.1.3-J diff -Naur stroke-0.1.3/src/aux.c stroke-0.1.3-J/src/aux.c --- stroke-0.1.3/src/aux.c 2011-02-24 13:36:34.000000000 +0000 +++ stroke-0.1.3-J/src/aux.c 2020-10-15 16:42:28.405609962 +0000 @@ -58,7 +58,7 @@ * Current verbosity level function. * Used as reference by libgeneral. */ -inline int +extern inline int verbosity_level() { return CHKF(VERBOSE); @@ -419,7 +419,7 @@...
I made this only change to the source and it seems to validate dates better: $ LC_ALL=C TZ=UTC0 diff -Naur aux.c.old aux.c --- aux.c.old 2020-10-15 16:42:54.085730137 +0000 +++ aux.c 2020-10-15 16:42:28.405609962 +0000 @@ -419,7 +419,7 @@ goto error; } - if(months >> D(MON) && D(DAY) > 30) { + if(months >> D(MON) & D(DAY) > 30) { goto error; } else if(D(MON) == 2) { /* leap year */ Checked with for D in {1..365}; do TS=$(date -d "20110101 + $D day" '+%Y%m%d 10:12:14'); echo $TS; touch -d "$TS" file...
I made this only change to the source and it seems to validate dates better: $ LC_ALL=C TZ=UTC0 diff -Naur aux.c.old aux.c --- aux.c.old 2020-10-15 16:42:54.085730137 +0000 +++ aux.c 2020-10-15 16:42:28.405609962 +0000 @@ -419,7 +419,7 @@ goto error; } - if(months >> D(MON) && D(DAY) > 30) { + if(months >> D(MON) & D(DAY) > 30) { goto error; } else if(D(MON) == 2) { /* leap year */