summaryrefslogtreecommitdiff
path: root/libc/misc/time
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2005-05-10 03:02:11 +0000
committerManuel Novoa III <mjn3@codepoet.org>2005-05-10 03:02:11 +0000
commit9d4c823b841300f20928582393f78898be86e136 (patch)
tree455a649ceafa780e8ee706020a1b23727bcebb45 /libc/misc/time
parent30c9f3c349aaffe6a791704b8167199fdd96e476 (diff)
Change strptime so that it only modifies struct tm fields specified.
Diffstat (limited to 'libc/misc/time')
-rw-r--r--libc/misc/time/time.c4
1 files changed, 3 insertions, 1 deletions
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. */