From aae02f62bd18899fbcf954f22ed23923c90c768b Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Sun, 16 Oct 2005 22:37:22 +0000 Subject: [PATCH] GoldEd can fall because of invalid time in message --- docs/notework.txt | 3 +++ goldlib/gall/gtimall.h | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/notework.txt b/docs/notework.txt index d419366..8ed60b4 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,9 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- GoldEd can fall because of invalid time in message. + (bugreport from Alexander Kolyada) + + New config file token: QuoteUseNewAI No/Yes. It will try to solve false quoting when '<' and '>' characters is used. diff --git a/goldlib/gall/gtimall.h b/goldlib/gall/gtimall.h index 41a972e..56b4704 100644 --- a/goldlib/gall/gtimall.h +++ b/goldlib/gall/gtimall.h @@ -172,9 +172,12 @@ char* TimeToStr(char* buf, time_t t); long YMD2JDN(unsigned yr, unsigned mo, unsigned day) __attribute__ ((const)); void JDN2YMD(long scalar, unsigned *yr, unsigned *mo, unsigned *day); -inline struct tm *gmtime(const time32_t *timep) { - const time_t temp(*timep); - return gmtime(&temp); +inline struct tm *gmtime(const time32_t *timep) +{ + const time_t zero(0); + const time_t temp(*timep); + struct tm *time = gmtime(&temp); + return time ? time : gmtime(&zero); } // ------------------------------------------------------------------