summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-09 00:24:39 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-09 00:24:39 +0800
commit4370dd5a94a80d21a9bcb7d5e464d4653f021dff (patch)
tree1ad0477b49ee01f94f0271d496e9a13044ccd94e
parentea6033df9651149316bd734bc7334f29f5045001 (diff)
downloadpttbbs-4370dd5a94a80d21a9bcb7d5e464d4653f021dff.tar
pttbbs-4370dd5a94a80d21a9bcb7d5e464d4653f021dff.tar.gz
pttbbs-4370dd5a94a80d21a9bcb7d5e464d4653f021dff.tar.bz2
pttbbs-4370dd5a94a80d21a9bcb7d5e464d4653f021dff.tar.lz
pttbbs-4370dd5a94a80d21a9bcb7d5e464d4653f021dff.tar.xz
pttbbs-4370dd5a94a80d21a9bcb7d5e464d4653f021dff.tar.zst
pttbbs-4370dd5a94a80d21a9bcb7d5e464d4653f021dff.zip
* define size of fromhost as IPV4LEN(15)+NUL.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4526 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/logind.h2
-rw-r--r--include/pttstruct.h7
2 files changed, 5 insertions, 4 deletions
diff --git a/include/logind.h b/include/logind.h
index aebbffea..f489f08c 100644
--- a/include/logind.h
+++ b/include/logind.h
@@ -17,7 +17,7 @@ typedef struct login_data
// user authentication
char userid[IDLEN+1];
- char hostip[32+1];
+ char hostip[IPV4LEN+1];
} login_data;
diff --git a/include/pttstruct.h b/include/pttstruct.h
index 33f4febc..fdfbb9c3 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -5,9 +5,10 @@
#include <netinet/in.h>
#include "cmsys.h" // for time4_t
#include "config.h" // various sizes in SHM
-#include "statistic.h" // for MAX_STATS
+#include "statistic.h" // for MAX_STATS
-#define IDLEN 12 /* Length of bid/uid */
+#define IDLEN (12) /* Length of bid/uid */
+#define IPV4LEN (15) /* a.b.c.d form */
// GCC pragma to prevent paddings
#define PACKSTRUCT __attribute__ ((packed))
@@ -80,7 +81,7 @@ typedef struct userec_t {
uint32_t numposts; /* 文章篇數 */
time4_t firstlogin; /* 註冊時間 */
time4_t lastlogin; /* 最近上站時間 */
- char lasthost[16]; /* 上次上站來源 */
+ char lasthost[IPV4LEN+1];/* 上次上站來源 */
int32_t money; /* Ptt幣 */
char unused[4];
char email[50]; /* Email */