From 3a32dfbebe11261b5ab4a76e3f6dbf75c5c940d9 Mon Sep 17 00:00:00 2001 From: piaip Date: Thu, 10 Jun 2010 18:49:38 +0000 Subject: * code refine: prevent arbitary format identifier git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5060 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/util/account.c | 2 +- pttbbs/util/inndBM.c | 2 +- pttbbs/util/merge_board.c | 4 ++-- pttbbs/util/openticket.c | 2 +- pttbbs/util/yearsold.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pttbbs/util/account.c b/pttbbs/util/account.c index 587ae284..34398700 100644 --- a/pttbbs/util/account.c +++ b/pttbbs/util/account.c @@ -69,7 +69,7 @@ my_outs(FILE *fp, char *buf, char mode) if (state != mode) fprintf(fp, "[3%cm", state = mode); if (buf[0]) { - fprintf(fp, buf); + fputs(buf, fp); buf[0] = 0; } } diff --git a/pttbbs/util/inndBM.c b/pttbbs/util/inndBM.c index 363220f5..9e9de37a 100644 --- a/pttbbs/util/inndBM.c +++ b/pttbbs/util/inndBM.c @@ -127,7 +127,7 @@ int dobbsnnrp(char *serverstr, int serverid,FILE *fpscript) server[serverid].address, serverstr); if(fpscript) - fprintf(fpscript, buf); + fputs(buf, fpscript); return 0; } int main(int argc, char **argv) diff --git a/pttbbs/util/merge_board.c b/pttbbs/util/merge_board.c index 4fc643c1..dc4aed0c 100644 --- a/pttbbs/util/merge_board.c +++ b/pttbbs/util/merge_board.c @@ -29,7 +29,7 @@ int is_exist(char *brdname) { int i; hash_t *n; - i = string_hash(brdname); + i = string_hash((unsigned char*)brdname); for(n = hash_tbl[i]; n != NULL; n = n->next) if(strcasecmp(brdname, n->brdname) == 0) return 1; @@ -40,7 +40,7 @@ void add_hash(char *brdname) { int i; hash_t *n; - i = string_hash(brdname); + i = string_hash((unsigned char*)brdname); n = malloc(sizeof(*n)); n->brdname = strdup(brdname); diff --git a/pttbbs/util/openticket.c b/pttbbs/util/openticket.c index c8af8c1a..b7577151 100644 --- a/pttbbs/util/openticket.c +++ b/pttbbs/util/openticket.c @@ -67,7 +67,7 @@ int main(int argc, char **argv) for (; n < MAX_DES && des[n][0] != 0; n++) { - fprintf(fp, des[n]); + fputs(des[n], fp); } printf("\n\n¶}¼ú®É¶¡¡G %s \n\n" diff --git a/pttbbs/util/yearsold.c b/pttbbs/util/yearsold.c index 1418cd59..2982650f 100644 --- a/pttbbs/util/yearsold.c +++ b/pttbbs/util/yearsold.c @@ -18,7 +18,7 @@ char buf[], mode; fprintf(fp, "[3%cm", state = mode); if (buf[0]) { - fprintf(fp, buf); + fputs(buf, fp); buf[0] = 0; } } -- cgit v1.2.3