Tcl Source Code

View Ticket
Login
Ticket UUID: f63b3ab13d9c71620bf725851eb13fb18985b44e
Title: Possible bug in clock scan
Type: Bug Created on: 2015-02-06 06:36:55
Submitter: [email protected] Assigned to: sebres
Subsystem: 16. Commands A-H Severity: Minor
Priority: 5 Medium Last modified: 2015-02-06 12:57:11
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 8.6.3
Description:
Clock scan does not check for consistency of the %u placeholder.

Scan a correct format string (YYYY mm dd HH MM SS DAYCOUNT):
OKAY: clock scan "2015 02 06 10 00 00 5" -format "%Y %m %d %H %M %S %u"
1423213200

Same date/Time with inconsistent day number:
FAIL: clock scan "2015 02 06 10 00 00 2" -format "%Y %m %d %H %M %S %u"
1423213200

This should not happen. It is strange but okay, that you can give a month number 99, as one can argue, clock just counts 99 months. But the example is an inconsistent date, that can not exist, since the date is a Friday and the daycount (%u) is set as day 2.
User Comments:
sebres added on 2015-02-06 12:56:47:
Possible a duplicate of #3475995 (and #3531146fffffffffffff).

Because, there is no verifying at all:

% clock format [clock scan "2015-02-31 00:00:00"] -format "%Y-%m-%d %X"
2015-03-03 00:00:00

I will commit my code fixes this and other issues with invalid scanning... 
At the moment in #3475995 enclosed a patch for 8.5.11