strptime bugs

Thorsten Kukuk kukuk@suse.de
Sun Dec 16 06:50:00 GMT 2001


On Sat, Dec 15, Ulrich Drepper wrote:

> Thorsten Kukuk <kukuk@suse.de> writes:
> 
> > strptime("12", "%I", &testbuf) should return tm_hour = 12
> > The range is [1,12], not [0,11]. But we return tm_hour = 0.
> 
> Which is OK.  %I alone can be interpreted as 0 hours or 12 hours (12am
> or 12pm).  And you are confusing input format specification [1,12]
> with the allowed values for tm_hour (defined in <time.h>).

12 is allowed for tm_hour. And I don't think that we are allowed
to modify correct input into another value, if the output would
be also correct.

> > The leading zeros are allowed.
> 
> Leading zeros refers to the zeros you can add before the digit for
> numbers < 10.

This is max. one zero, but the draft explicit writes zeros.

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE GmbH            Deutschherrenstr. 15-19       D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B



More information about the Libc-hacker mailing list