Commit 3e63ad32 authored by Matteo Quintiliani's avatar Matteo Quintiliani

Fixed problem


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@811 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent ddc7b015
......@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it
*
* $Id: nmxp_data.c,v 1.53 2008-02-28 14:01:17 mtheo Exp $
* $Id: nmxp_data.c,v 1.54 2008-02-28 14:05:10 mtheo Exp $
*
*/
......@@ -392,7 +392,7 @@ int nmxp_data_parse_date(const char *pstr_date, NMXP_TM_T *ret_tmt) {
struct tm *tm_now;
int month_days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int m, d, day_sum, jday=app;
int m, d, day_sum, jday;
nmxp_log(NMXP_LOG_NORM, NMXP_LOG_D_DATE, "Date to validate '%s'\n", NMXP_LOG_STR(pstr_date));
......@@ -414,6 +414,8 @@ int nmxp_data_parse_date(const char *pstr_date, NMXP_TM_T *ret_tmt) {
}
/* initialize ret_tmt */
time(&time_now);
tm_now = gmtime(&time_now);
ret_tmt->t.tm_sec = 0 ;
ret_tmt->t.tm_min = 0;
......@@ -480,6 +482,8 @@ int nmxp_data_parse_date(const char *pstr_date, NMXP_TM_T *ret_tmt) {
case 3: /* Parse Julian Day */
ret_tmt->t.tm_yday = app - 1;
jday=app;
if(NMXP_DATA_IS_LEAP(ret_tmt->t.tm_year)) {
month_days[1]++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment