diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-19 22:45:06 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-19 22:45:06 +0800 |
commit | acf58ca18005d3ed917cbc80a33baeec9d44335f (patch) | |
tree | 0c76bbf0ca5b4284e81d631b60f7180c65c71138 /mbbsd/stuff.c | |
parent | 08ae8ba0331d27fc196d41a0cbc480c5ee3aa0c6 (diff) | |
download | pttbbs-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/stuff.c')
-rw-r--r-- | mbbsd/stuff.c | 5 |
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); |