summaryrefslogtreecommitdiffstats
path: root/mbbsd/syspost.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-21 16:18:42 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-21 16:18:42 +0800
commit1428a82d1644166fdaa5285c67f236ac02687818 (patch)
tree276d0104ebeaef1c5ce7ab7cf8484a685669a15d /mbbsd/syspost.c
parent913a0db139ff6f56e26d1199e7f5ad1c6239c5ea (diff)
downloadpttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar
pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.gz
pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.bz2
pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.lz
pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.xz
pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.zst
pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.zip
strcpy() -> strlcpy()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@428 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/syspost.c')
-rw-r--r--mbbsd/syspost.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c
index 15caf482..6439a735 100644
--- a/mbbsd/syspost.c
+++ b/mbbsd/syspost.c
@@ -1,4 +1,4 @@
-/* $Id: syspost.c,v 1.12 2002/07/05 17:10:28 in2 Exp $ */
+/* $Id: syspost.c,v 1.13 2002/07/21 08:18:41 in2 Exp $ */
#include "bbs.h"
void
@@ -9,7 +9,7 @@ post_change_perm(int oldperm, int newperm, char *sysopid, char *userid)
char genbuf[200], reason[30];
int i, flag = 0;
- strcpy(genbuf, "boards/S/Security");
+ strlcpy(genbuf, "boards/S/Security", sizeof(genbuf));
stampfile(genbuf, &fhdr);
if (!(fp = fopen(genbuf, "w")))
return;
@@ -38,7 +38,7 @@ post_change_perm(int oldperm, int newperm, char *sysopid, char *userid)
sprintf(fhdr.title, "[公安報告] 站長%s修改%s權限報告",
cuser.userid, userid);
- strcpy(fhdr.owner, "[系統安全局]");
+ strlcpy(fhdr.owner, "[系統安全局]", sizeof(fhdr.owner));
append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr));
}
}
@@ -49,7 +49,7 @@ post_violatelaw(char *crime, char *police, char *reason, char *result)
char genbuf[200];
fileheader_t fhdr;
FILE *fp;
- strcpy(genbuf, "boards/S/Security");
+ strlcpy(genbuf, "boards/S/Security", sizeof(genbuf));
stampfile(genbuf, &fhdr);
if (!(fp = fopen(genbuf, "w")))
return;
@@ -61,10 +61,10 @@ post_violatelaw(char *crime, char *police, char *reason, char *result)
crime, ctime(&now), police, crime, reason, result);
fclose(fp);
sprintf(fhdr.title, "[報告] %-20s 違法判決報告", crime);
- strcpy(fhdr.owner, "[Ptt法院]");
+ strlcpy(fhdr.owner, "[Ptt法院]", sizeof(fhdr.owner));
append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr));
- strcpy(genbuf, "boards/V/ViolateLaw");
+ strlcpy(genbuf, "boards/V/ViolateLaw", sizeof(genbuf));
stampfile(genbuf, &fhdr);
if (!(fp = fopen(genbuf, "w")))
return;
@@ -76,7 +76,7 @@ post_violatelaw(char *crime, char *police, char *reason, char *result)
crime, ctime(&now), police, crime, reason, result);
fclose(fp);
sprintf(fhdr.title, "[報告] %-20s 違法判決報告", crime);
- strcpy(fhdr.owner, "[Ptt法院]");
+ strlcpy(fhdr.owner, "[Ptt法院]", sizeof(fhdr.owner));
append_record("boards/V/ViolateLaw/.DIR", &fhdr, sizeof(fhdr));
@@ -100,7 +100,7 @@ give_money_post(char *userid, int money)
time_t now = time(0);
char genbuf[200];
- strcpy(genbuf, "boards/S/Security");
+ strlcpy(genbuf, "boards/S/Security", sizeof(genbuf));
stampfile(genbuf, &fhdr);
if (!(fp = fopen(genbuf, "w")))
return;
@@ -115,6 +115,6 @@ give_money_post(char *userid, int money)
fclose(fp);
sprintf(fhdr.title, "[公安報告] 站長%s使用紅包機報告",
cuser.userid);
- strcpy(fhdr.owner, "[系統安全局]");
+ strlcpy(fhdr.owner, "[系統安全局]", sizeof(fhdr.owner));
append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr));
}