--- libelwix/src/time.c 2013/03/07 15:47:07 1.1.2.3 +++ libelwix/src/time.c 2013/03/07 15:56:22 1.1.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: time.c,v 1.1.2.3 2013/03/07 15:47:07 misho Exp $ +* $Id: time.c,v 1.1.2.5 2013/03/07 15:56:22 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -135,7 +135,7 @@ search4wday(char * __restrict psWDay, int * __restrict * time_Parse() - Parse and make unix time from standart time strings ... * * @csTime = Time string - * return: =0 error or !=0 converted time + * return: =-1 error or !=-1 converted time */ time_t time_Parse(const char *csTime) @@ -247,8 +247,10 @@ time_Parse(const char *csTime) tm.tm_min = tm_min; tm.tm_sec = tm_sec; tm.tm_year = tm_year; - } else + } else { + elwix_SetErr(EINVAL, "Invalid date/time format"); return (time_t) -1; + } if (tm.tm_year > 1900) tm.tm_year -= 1900; @@ -256,7 +258,6 @@ time_Parse(const char *csTime) tm.tm_year += 100; if ((tim = timegm(&tm)) == (time_t) -1) - return 0; - else - return tim; + elwix_SetErr(EINVAL, "Invalid date/time format"); + return tim; }