From ca9e48d5f67e0cc638c6c8d75e3ce8be6098d160 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Fri, 30 Apr 2021 20:48:30 -0400 Subject: [PATCH] Fix some warnings related to format strings. --- arogue5/command.c | 2 +- arogue5/init.c | 2 +- arogue5/rip.c | 2 +- arogue7/command.c | 2 +- arogue7/init.c | 2 +- xrogue/command.c | 2 +- xrogue/init.c | 2 +- xrogue/state.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arogue5/command.c b/arogue5/command.c index 94a901a..d73c33b 100644 --- a/arogue5/command.c +++ b/arogue5/command.c @@ -854,7 +854,7 @@ shell(void) md_shellescape(); - printf(retstr); + printf("%s", retstr); fflush(stdout); nonl(); noecho(); diff --git a/arogue5/init.c b/arogue5/init.c index cb17efe..31b5080 100644 --- a/arogue5/init.c +++ b/arogue5/init.c @@ -107,7 +107,7 @@ badcheck(char *name, struct magic_item *magic, int bound) printf("\nBad percentages for %s:\n", name); for (end = &magic[bound] ; magic < end ; magic++) printf("%4d%% %s\n", magic->mi_prob, magic->mi_name); - printf(retstr); + printf("%s", retstr); fflush(stdout); while (getchar() != '\n') continue; diff --git a/arogue5/rip.c b/arogue5/rip.c index eab5ee0..d6466d1 100644 --- a/arogue5/rip.c +++ b/arogue5/rip.c @@ -632,7 +632,7 @@ scorein(struct sc_ent scores[], FILE *inf) encread((char *) &scores[i].sc_system, SYSLEN, inf); encread((char *) &scores[i].sc_login, LINELEN, inf); encread((char *) scoreline, 100, inf); - sscanf(scoreline, " %lu %d %d %d %d %d \n", + sscanf(scoreline, " %lu %hd %hd %hd %hd %hd \n", &scores[i].sc_score, &scores[i].sc_flgs, &scores[i].sc_level, &scores[i].sc_ctype, &scores[i].sc_monster, &scores[i].sc_quest); diff --git a/arogue7/command.c b/arogue7/command.c index 3ef022f..0e9a1b8 100644 --- a/arogue7/command.c +++ b/arogue7/command.c @@ -1047,7 +1047,7 @@ shell(void) md_shellescape(); - printf(retstr); + printf("%s", retstr); noecho(); raw(); keypad(cw,1); diff --git a/arogue7/init.c b/arogue7/init.c index 73f43b2..1cca5f5 100644 --- a/arogue7/init.c +++ b/arogue7/init.c @@ -128,7 +128,7 @@ badcheck(char *name, struct magic_item *magic, int bound) printf("\nBad percentages for %s:\n", name); for (end = &magic[bound] ; magic < end ; magic++) printf("%4d%% %s\n", magic->mi_prob, magic->mi_name); - printf(retstr); + printf("%s", retstr); fflush(stdout); while (getchar() != '\n') continue; diff --git a/xrogue/command.c b/xrogue/command.c index 11f4fab..6c54793 100644 --- a/xrogue/command.c +++ b/xrogue/command.c @@ -1079,7 +1079,7 @@ shell(void) md_shellescape(); - printf(retstr); + printf("%s", retstr); fflush(stdout); noecho(); crmode(); diff --git a/xrogue/init.c b/xrogue/init.c index f2e43c4..dfa1ae0 100644 --- a/xrogue/init.c +++ b/xrogue/init.c @@ -119,7 +119,7 @@ badcheck(char *name, struct magic_item *magic, int bound) printf("\nBad percentages for %s:\n", name); for (end = &magic[bound] ; magic < end ; magic++) printf("%4d%% %s\n", magic->mi_prob, magic->mi_name); - printf(retstr); + printf("%s", retstr); fflush(stdout); while (getchar() != '\n') continue; diff --git a/xrogue/state.c b/xrogue/state.c index 0856e33..68aee34 100644 --- a/xrogue/state.c +++ b/xrogue/state.c @@ -3102,7 +3102,7 @@ rs_print_thing(FILE *outf, struct thing *thing, char *prefix, int list, int inde fprintf(outf,"%st_flags : ", prefix); for(i = 0; i<16; i++) - fprintf(outf,"%X ",thing->t_flags[i]); + fprintf(outf,"%lX ",thing->t_flags[i]); fprintf(outf,"\n"); fprintf(outf,"%st_pack : %p\n",prefix,thing->t_pack);