From 9d4c823b841300f20928582393f78898be86e136 Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Tue, 10 May 2005 03:02:11 +0000 Subject: Change strptime so that it only modifies struct tm fields specified. --- libc/misc/time/time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index ac2fe5926..7b1ae388b 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -1406,7 +1406,9 @@ char *__XL(strptime)(const char *__restrict buf, const char *__restrict format, i = 0; do { /* Store the values into tm. */ - ((int *) tm)[i] = fields[i]; + if (fields[i] != INT_MIN) { + ((int *) tm)[i] = fields[i]; + } } while (++i < 8); return (char *) buf; /* Success. */ -- cgit v1.2.3