diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-10 15:08:55 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-10 15:08:55 +0800 |
commit | 7844305800a7a4781ac46777d429dbe667327911 (patch) | |
tree | 28e429be86f0ecc20cb7d30d95d054b420f09bc9 /mbbsd/edit.c | |
parent | 3b109adbea257408835589c45e0125f77064274c (diff) | |
download | pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.gz pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.bz2 pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.lz pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.xz pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.zst pttbbs-7844305800a7a4781ac46777d429dbe667327911.zip |
replace some prints() with outs(),
replace some outs() with outc(),
replace some fprintf() with fputs(),
and so on.
for performance.
and don't treat user input as format string.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2055 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r-- | mbbsd/edit.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c index d8c7d80f..637b7736 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -256,7 +256,7 @@ ask(char *prompt) move(0, 0); clrtoeol(); standout(); - prints("%s", prompt); + outs(prompt); standend(); ch = igetch(); move(0, 0); @@ -836,8 +836,7 @@ write_header(FILE * fp) ifuseanony = 1; } else { if (!strcmp("r", real_name) || (!defanony && !real_name[0])) - snprintf(postlog.author, sizeof(postlog.author), - "%s", cuser.userid); + strlcpy(postlog.author, cuser.userid, sizeof(postlog.author)); else { snprintf(postlog.author, sizeof(postlog.author), "%s.", real_name); @@ -989,7 +988,7 @@ write_file(char *fpath, int saveheader, int *islocal) if (!HAS_PERM(PERM_LOGINOK)) { local_article = 1; move(2, 0); - prints("您尚未通過身份確認,只能 Local Save。\n"); + outs("您尚未通過身份確認,只能 Local Save。\n"); pressanykey(); } else local_article = 0; |