aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'time/strptime_l.c')
-rw-r--r--time/strptime_l.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/time/strptime_l.c b/time/strptime_l.c
index 5640ccecce..4203ad81a0 100644
--- a/time/strptime_l.c
+++ b/time/strptime_l.c
@@ -770,16 +770,10 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
else if (n != 4)
/* Only two or four digits recognized. */
return NULL;
- else
- {
- /* We have to convert the minutes into decimal. */
- if (val % 100 >= 60)
- return NULL;
- val = (val / 100) * 100 + ((val % 100) * 50) / 30;
- }
- if (val > 1200)
+ else if (val % 100 >= 60)
+ /* Minutes valid range is 0 through 59. */
return NULL;
- tm->tm_gmtoff = (val * 3600) / 100;
+ tm->tm_gmtoff = (val / 100) * 3600 + (val % 100) * 60;
if (neg)
tm->tm_gmtoff = -tm->tm_gmtoff;
}