diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-22 04:43:35 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-22 04:43:35 +0800 |
commit | d1e6db6c80349c202d4b5181809856e61bebb774 (patch) | |
tree | afb2ea5dfd8cb7fe6953c7a1969543c1de23a36b | |
parent | 31f988054ac338c6b41e6242a15cb06c9c1e0495 (diff) | |
download | pttbbs-d1e6db6c80349c202d4b5181809856e61bebb774.tar pttbbs-d1e6db6c80349c202d4b5181809856e61bebb774.tar.gz pttbbs-d1e6db6c80349c202d4b5181809856e61bebb774.tar.bz2 pttbbs-d1e6db6c80349c202d4b5181809856e61bebb774.tar.lz pttbbs-d1e6db6c80349c202d4b5181809856e61bebb774.tar.xz pttbbs-d1e6db6c80349c202d4b5181809856e61bebb774.tar.zst pttbbs-d1e6db6c80349c202d4b5181809856e61bebb774.zip |
fix last commit(about sprintf->snprintf)
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@433 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/vote.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/pttbbs/mbbsd/vote.c b/pttbbs/mbbsd/vote.c index 29d648a5..fb1c40e9 100644 --- a/pttbbs/mbbsd/vote.c +++ b/pttbbs/mbbsd/vote.c @@ -1,4 +1,4 @@ -/* $Id: vote.c,v 1.13 2002/07/21 20:39:34 kcwu Exp $ */ +/* $Id: vote.c,v 1.14 2002/07/21 20:43:35 kcwu Exp $ */ #include "bbs.h" static int total; @@ -287,7 +287,7 @@ b_result(boardheader_t * fh) for (i = 0; i < 20; i++) { if (i) - sprintf(STR_new_control, sizeof(STR_new_control), "%s%d", STR_bv_control, i); + snprintf(STR_new_control, sizeof(STR_new_control), "%s%d", STR_bv_control, i); else strlcpy(STR_new_control, STR_bv_control, sizeof(STR_new_control)); @@ -367,13 +367,13 @@ vote_view(char *bname, int index) time_t closetime; if (index) { - sprintf(STR_new_ballots, sizeof(STR_new_ballots),"%s%d", STR_bv_ballots, index); - sprintf(STR_new_control, sizeof(STR_new_control), "%s%d", STR_bv_control, index); - sprintf(STR_new_desc, sizeof(STR_new_desc), "%s%d", STR_bv_desc, index); - sprintf(STR_new_flags, sizeof(STR_new_flags), "%s%d", STR_bv_flags, index); - sprintf(STR_new_comments, sizeof(STR_new_comments), "%s%d", STR_bv_comments, index); - sprintf(STR_new_limited, sizeof(STR_new_limited), "%s%d", STR_bv_limited, index); - sprintf(STR_new_title, sizeof(STR_new_title), "%s%d", STR_bv_title, index); + snprintf(STR_new_ballots, sizeof(STR_new_ballots),"%s%d", STR_bv_ballots, index); + snprintf(STR_new_control, sizeof(STR_new_control), "%s%d", STR_bv_control, index); + snprintf(STR_new_desc, sizeof(STR_new_desc), "%s%d", STR_bv_desc, index); + snprintf(STR_new_flags, sizeof(STR_new_flags), "%s%d", STR_bv_flags, index); + snprintf(STR_new_comments, sizeof(STR_new_comments), "%s%d", STR_bv_comments, index); + snprintf(STR_new_limited, sizeof(STR_new_limited), "%s%d", STR_bv_limited, index); + snprintf(STR_new_title, sizeof(STR_new_title), "%s%d", STR_bv_title, index); } else { strlcpy(STR_new_ballots, STR_bv_ballots, sizeof(STR_new_ballots)); strlcpy(STR_new_control, STR_bv_control, sizeof(STR_new_control)); @@ -618,13 +618,13 @@ vote_maintain(char *bname) if (x >= 20) return FULLUPDATE; if (x) { - sprintf(STR_new_ballots, sizeof(STR_new_ballots), "%s%d", STR_bv_ballots, x); - sprintf(STR_new_control, sizeof(STR_new_control), "%s%d", STR_bv_control, x); - sprintf(STR_new_desc, sizeof(STR_new_desc), "%s%d", STR_bv_desc, x); - sprintf(STR_new_flags, sizeof(STR_new_flags), "%s%d", STR_bv_flags, x); - sprintf(STR_new_comments, sizeof(STR_new_comments), "%s%d", STR_bv_comments, x); - sprintf(STR_new_limited, sizeof(STR_new_limited), "%s%d", STR_bv_limited, x); - sprintf(STR_new_title, sizeof(STR_new_title), "%s%d", STR_bv_title, x); + snprintf(STR_new_ballots, sizeof(STR_new_ballots), "%s%d", STR_bv_ballots, x); + snprintf(STR_new_control, sizeof(STR_new_control), "%s%d", STR_bv_control, x); + snprintf(STR_new_desc, sizeof(STR_new_desc), "%s%d", STR_bv_desc, x); + snprintf(STR_new_flags, sizeof(STR_new_flags), "%s%d", STR_bv_flags, x); + snprintf(STR_new_comments, sizeof(STR_new_comments), "%s%d", STR_bv_comments, x); + snprintf(STR_new_limited, sizeof(STR_new_limited), "%s%d", STR_bv_limited, x); + snprintf(STR_new_title, sizeof(STR_new_title), "%s%d", STR_bv_title, x); } else { strlcpy(STR_new_ballots, STR_bv_ballots, sizeof(STR_new_ballots)); strlcpy(STR_new_control, STR_bv_control, sizeof(STR_new_control)); @@ -734,7 +734,7 @@ vote_flag(char *bname, int index, char val) int fd, num, size; if (index) - sprintf(STR_new_flags, sizeof(STR_new_flags), "%s%d", STR_bv_flags, index); + snprintf(STR_new_flags, sizeof(STR_new_flags), "%s%d", STR_bv_flags, index); else strlcpy(STR_new_flags, STR_bv_flags, sizeof(STR_new_flags)); @@ -784,12 +784,12 @@ user_vote_one(char *bname, int ind) time_t closetime; if (ind) { - sprintf(STR_new_ballots, sizeof(STR_new_ballots), "%s%d", STR_bv_ballots, ind); - sprintf(STR_new_control, sizeof(STR_new_control), "%s%d", STR_bv_control, ind); - sprintf(STR_new_desc, sizeof(STR_new_desc), "%s%d", STR_bv_desc, ind); - sprintf(STR_new_flags, sizeof(STR_new_flags),"%s%d", STR_bv_flags, ind); - sprintf(STR_new_comments, sizeof(STR_new_comments), "%s%d", STR_bv_comments, ind); - sprintf(STR_new_limited, sizeof(STR_new_limited), "%s%d", STR_bv_limited, ind); + snprintf(STR_new_ballots, sizeof(STR_new_ballots), "%s%d", STR_bv_ballots, ind); + snprintf(STR_new_control, sizeof(STR_new_control), "%s%d", STR_bv_control, ind); + snprintf(STR_new_desc, sizeof(STR_new_desc), "%s%d", STR_bv_desc, ind); + snprintf(STR_new_flags, sizeof(STR_new_flags),"%s%d", STR_bv_flags, ind); + snprintf(STR_new_comments, sizeof(STR_new_comments), "%s%d", STR_bv_comments, ind); + snprintf(STR_new_limited, sizeof(STR_new_limited), "%s%d", STR_bv_limited, ind); } else { strlcpy(STR_new_ballots, STR_bv_ballots, sizeof(STR_new_ballots)); strlcpy(STR_new_control, STR_bv_control, sizeof(STR_new_control)); |