summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-19 22:45:06 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-19 22:45:06 +0800
commitacf58ca18005d3ed917cbc80a33baeec9d44335f (patch)
tree0c76bbf0ca5b4284e81d631b60f7180c65c71138 /mbbsd
parent08ae8ba0331d27fc196d41a0cbc480c5ee3aa0c6 (diff)
downloadpttbbs-acf58ca18005d3ed917cbc80a33baeec9d44335f.tar
pttbbs-acf58ca18005d3ed917cbc80a33baeec9d44335f.tar.gz
pttbbs-acf58ca18005d3ed917cbc80a33baeec9d44335f.tar.bz2
pttbbs-acf58ca18005d3ed917cbc80a33baeec9d44335f.tar.lz
pttbbs-acf58ca18005d3ed917cbc80a33baeec9d44335f.tar.xz
pttbbs-acf58ca18005d3ed917cbc80a33baeec9d44335f.tar.zst
pttbbs-acf58ca18005d3ed917cbc80a33baeec9d44335f.zip
- better range checking on time_4t
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3709 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/stuff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index 0316bc50..e65ee2c2 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -224,7 +224,10 @@ gettime(int line, time4_t dt, const char*head)
i=strlen(head);
do {
getdata_buf(line, i, " ¦è¤¸¦~:", yn, 5, LCECHO);
- } while ((endtime.tm_year = atoi(yn) - 1900) < 0 || endtime.tm_year > 200);
+ // signed: limited on (2037, ...)
+ // unsigned: limited on (..., 1970)
+ // let's restrict inside the boundary.
+ } while ((endtime.tm_year = atoi(yn) - 1900) < 70 || endtime.tm_year > 135);
snprintf(yn, sizeof(yn), "%d", ptime->tm_mon + 1);
do {
getdata_buf(line, i+15, "¤ë:", yn, 3, LCECHO);