From: Elena Mamontova Date: Thu, 17 Nov 2016 08:06:55 +0000 (+0200) Subject: Ticket 37. if (year < 1990) checking added in the ts2time() function. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/92f801286d90e89f800f8768e01da2a0be7cd7e8?ds=sidebyside Ticket 37. if (year < 1990) checking added in the ts2time() function. --- diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_utils.cpp b/projects/stargazer/plugins/store/firebird/firebird_store_utils.cpp index 96eb817d..bbbc8794 100644 --- a/projects/stargazer/plugins/store/firebird/firebird_store_utils.cpp +++ b/projects/stargazer/plugins/store/firebird/firebird_store_utils.cpp @@ -41,6 +41,8 @@ time_t ts2time_t(const IBPP::Timestamp & ts) memset(&time_tm, 0, sizeof(time_tm)); ts.GetDate(year, month, day); ts.GetTime(hour, min, sec); + if (year < 1990) + return 0; sprintf(buf, "%d-%d-%d %d:%d:%d", year, month, day, hour, min, sec); stg_strptime(buf, "%Y-%m-%d %H:%M:%S", &time_tm);