From 524cf39786d03e89c4b4652d4543c280b1e699d7 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Thu, 9 Dec 1999 16:01:23 +0000 Subject: [PATCH] There was a bug when converting ascii string format to time stamp. The bug involved the year 00 appeared in the ascii string --- src/libCom/tsSubr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libCom/tsSubr.c b/src/libCom/tsSubr.c index fa0e2053e..b78ddfc8f 100644 --- a/src/libCom/tsSubr.c +++ b/src/libCom/tsSubr.c @@ -1315,7 +1315,7 @@ char **pCallerText) /* IO ptr to ptr to string containing time and date */ } if (retStat == S_ts_OK) { count = nextIntFieldAsInt(pText, &t.year, &delim); - if (count <= 1 || t.year <= 0) + if (count <= 1 || t.year < 0 || (count > 3 && t.year < TS_EPOCH_YEAR)) retStat = S_ts_inputTextError; else if (!isspace(delim)) retStat = S_ts_inputTextError; @@ -1365,7 +1365,7 @@ char **pCallerText) /* IO ptr to ptr to string containing time and date */ } if (retStat == S_ts_OK) { count = nextIntFieldAsInt(pText, &t.year, &delim); - if (count <= 1 || t.year <= 0) + if (count <= 1 || t.year < 0 || (count > 3 && t.year < TS_EPOCH_YEAR)) retStat = S_ts_inputTextError; else if (!isspace(delim)) retStat = S_ts_inputTextError;