Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Mar 2003 05:10:15 -0800 (PST)
From:      Mike Makonnen <mtm@identd.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/48993: strptime() does not fill in some fields of struct tm
Message-ID:  <200303071310.h27DAFj9016956@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/48993; it has been noted by GNATS.

From: Mike Makonnen <mtm@identd.net>
To: "Nick Triantos" <nick@triantos.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: misc/48993: strptime() does not fill in some fields of struct
 tm
Date: Fri, 7 Mar 2003 08:08:19 -0500

 Well, the man page says:
 
      If the format string does not contain enough conversion specifications to
      completely specify the resulting struct tm, the unspecified members of
      timeptr are left untouched.  For example, if format is ``%H:%M:%S'', only
      tm_hour, tm_sec and tm_min will be modified.  If time relative to today
      is desired, initialize the timeptr structure with today's date before
      passing it to strptime().
 
 This is a clear contradiction with the actual code since, if the %s or %Z
 specifiers are used then GMT processing is assumed (unconditionaly for the first
 and conditional upon a GMT string in the second case) and the rest of the fields
 are filled in. This does not occur if a non-GMT time is used. This strikes me as
 inconsistent. Either the rest of the fields should be unconditionaly filled in
 or not. Your suggestion seems reasonable, but I don't know if there are any
 Standards issues involved.
 I'll supply a patch to  freebsd-standards, and if no one objects, commit it.
 
 Cheers
 -- 
 Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
 mtm@identd.net | Fingerprint: D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303071310.h27DAFj9016956>