• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisiond35ce4aec281386ea3e96c7e2ae6d6b115637566 (tree)
Time2012-11-17 01:11:55
Authorhabu <habu@0568...>
Commiterhabu

Log Message

fprintf(fp, buf) を fputs(buf, fp) に修正

gccのwarningにより発見
bufに%が含まれた場合セキュリティホールとなり得る

Change Summary

Incremental Difference

--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -6121,7 +6121,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
61216121 tmpfff = my_fopen(buf, "r");
61226122 if (!tmpfff) {
61236123 for (i = 0; html_head[i]; i++)
6124- fprintf(fff, html_head[i]);
6124+ fputs(html_head[i], fff);
61256125 }
61266126 else {
61276127 yomikomu = 0;
@@ -6183,7 +6183,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
61836183
61846184 if (!tmpfff) {
61856185 for (i = 0; html_foot[i]; i++)
6186- fprintf(fff, html_foot[i]);
6186+ fputs(html_foot[i], fff);
61876187 }
61886188 else {
61896189 rewind(tmpfff);
@@ -9319,7 +9319,7 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
93199319 quest[i].name, quest[i].level, note);
93209320 #endif
93219321
9322- fprintf(fff, tmp_str);
9322+ fputs(tmp_str, fff);
93239323
93249324 if (quest[i].status == QUEST_STATUS_COMPLETED)
93259325 {
@@ -9328,7 +9328,7 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
93289328 #else
93299329 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
93309330 #endif
9331- fprintf(fff, tmp_str);
9331+ fputs(tmp_str, fff);
93329332 }
93339333 else
93349334 {
@@ -9382,7 +9382,7 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
93829382 }
93839383
93849384 /* Print the current random quest */
9385- if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
9385+ if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
93869386
93879387 #ifdef JP
93889388 if (!total) fprintf(fff, " なし\n");
@@ -9473,7 +9473,7 @@ void do_cmd_knowledge_quests_completed(FILE *fff, int quest_num[])
94739473 #endif
94749474 }
94759475
9476- fprintf(fff, tmp_str);
9476+ fputs(tmp_str, fff);
94779477 }
94789478 }
94799479 #ifdef JP
@@ -9547,7 +9547,7 @@ void do_cmd_knowledge_quests_failed(FILE *fff, int quest_num[])
95479547 quest[q_idx].name, quest[q_idx].level, quest[q_idx].complev);
95489548 #endif
95499549 }
9550- fprintf(fff, tmp_str);
9550+ fputs(tmp_str, fff);
95519551 }
95529552 }
95539553 #ifdef JP
@@ -9589,7 +9589,7 @@ static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
95899589 sprintf(tmp_str, " %s (%d, %s)\n",
95909590 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
95919591 #endif
9592- fprintf(fff, tmp_str);
9592+ fputs(tmp_str, fff);
95939593 }
95949594 }
95959595 #ifdef JP
--- a/src/files.c
+++ b/src/files.c
@@ -4346,7 +4346,7 @@ static void dump_aux_class_special(FILE *fff)
43464346
43474347 for (i=0;i<=col;i++)
43484348 {
4349- fprintf(fff, p[i]);
4349+ fputs(p[i], fff);
43504350 }
43514351 }
43524352 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
Show on old repository browser