This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strptime() clobbers its return values


I neglected to include the ChangeLog updates in the previous patch. Here they are.

Dan Jakubiec wrote:
strptime() initializes the contents of its "struct tm" return structure at the beginning of the function. However, several of the strptime() format specifiers result in recursive calls to strptime() which then clobber any values which were parsed earlier in the format string. In particular, the following format specifiers call strptime() recursively: %D, %r, %R, %T, %X, %x.

-- Dan Jakubiec Systech Corporation

Index: ecos/packages/language/c/libc/time/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/language/c/libc/time/current/ChangeLog,v
retrieving revision 1.20
diff -u -5 -p -r1.20 ChangeLog
--- ecos/packages/language/c/libc/time/current/ChangeLog	27 Mar 2005 17:28:26 -0000	1.20
+++ ecos/packages/language/c/libc/time/current/ChangeLog	13 Jun 2006 17:50:16 -0000
@@ -1,5 +1,11 @@
+2006-06-13  Dan Jakubiec  <dan.jakubiec@systech.com>
+
+	* src/strptime.cxx: Removed the initialization of the struct tm fields
+	to prevent clobbering of time values when using the following format
+	specifiers: %D, %r, %R, %T, %X, %x.
+
 2005-03-27  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* include/time.h: Added CYGBLD_ATTRIB_STRFTIME_FORMAT where
 	appropriate so the compiler does more checking.
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]