diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-13 10:31:32 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-13 10:31:32 +0800 |
commit | 1031eaeff26f63ca8873244b541df3a1d2a34821 (patch) | |
tree | 008952ef06edb0c5c7a3e9b68e2d0d38e886f34f /mbbsd | |
parent | d67d47b0f57b71f2bf8321940e49dc13fadb8bc9 (diff) | |
download | pttbbs-1031eaeff26f63ca8873244b541df3a1d2a34821.tar pttbbs-1031eaeff26f63ca8873244b541df3a1d2a34821.tar.gz pttbbs-1031eaeff26f63ca8873244b541df3a1d2a34821.tar.bz2 pttbbs-1031eaeff26f63ca8873244b541df3a1d2a34821.tar.lz pttbbs-1031eaeff26f63ca8873244b541df3a1d2a34821.tar.xz pttbbs-1031eaeff26f63ca8873244b541df3a1d2a34821.tar.zst pttbbs-1031eaeff26f63ca8873244b541df3a1d2a34821.zip |
* fix some buffer line length (for display, so 256 -> ANSILINELEN would be better.)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4588 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/user.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c index ebeb53c3..7b482f24 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1134,7 +1134,7 @@ u_cloak(void) void showplans_userec(userec_t *user) { - char genbuf[200]; + char genbuf[ANSILINELEN]; if(user->userlevel & PERM_VIOLATELAW) { @@ -1150,16 +1150,16 @@ showplans_userec(userec_t *user) sethomefile(genbuf, user->userid, chess_photo_name[user_query_mode - 1]); if ((fp = fopen(genbuf, "r")) != NULL) { - char photo[6][256]; + char photo[6][ANSILINELEN]; int kingdom_bid = 0; int win = 0, lost = 0; move(7, 0); - while (i < 12 && fgets(genbuf, 256, fp)) + while (i < 12 && fgets(genbuf, sizeof(genbuf), fp)) { chomp(genbuf); if (i < 6) /* Ū·Ó¤ùÀÉ */ - strcpy(photo[i], genbuf); + strlcpy(photo[i], genbuf, sizeof(photo[i])); else if (i == 6) kingdom_bid = atoi(genbuf); else @@ -1206,7 +1206,7 @@ int showsignature(char *fname, int *j, SigInfo *si) { FILE *fp; - char buf[256]; + char buf[ANSILINELEN]; int i, lines = scr_lns; char ch; |