From 577c241438587e6d0b5b3fab01cc7ed30eaae3d1 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 27 Feb 2008 12:24:58 +0100 Subject: [PATCH] parse_time: set tm_sec to zero before conditional second parsing This fixes test 9 (Basic VMS responses) that uses time specs with seconds left out (e.g. 17:44) for me. (cherry picked from commit 397bef882bae5f2bdc7f09314a845bbaa01c922e) --- src/protocol/date.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/protocol/date.c b/src/protocol/date.c index bdd724772..f75489ede 100644 --- a/src/protocol/date.c +++ b/src/protocol/date.c @@ -128,6 +128,7 @@ parse_time(const unsigned char **time, struct tm *tm, unsigned char *end) tm->tm_hour = (h1 - '0') * 10 + h2 - '0'; tm->tm_min = (m1 - '0') * 10 + m2 - '0'; + tm->tm_sec = 0; /* Eat :SS or [PA]M or nothing */ if (end && date + 2 >= end) {