SHA256
1
0
forked from pool/vitetris
vitetris/0002-fix-insecure-printf.patch

46 lines
1.2 KiB
Diff
Raw Normal View History

From: Baptiste BEAUPLAT <lyknode@cilg.org>
Date: Mon, 15 Oct 2018 20:57:40 +0200
Subject: fix-insecure-printf
Fix insecure printf
---
src/cfgfile.c | 4 ++--
src/cmdline.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/cfgfile.c b/src/cfgfile.c
index 53210a6..b74083b 100644
--- a/src/cfgfile.c
+++ b/src/cfgfile.c
@@ -300,7 +300,7 @@ static void printbtnmapping(FILE *fp, int n, int keypress, int i)
return;
fprintf(fp, "%s=", input_keynames[i]);
if (b < 10)
- fprintf(fp, input_chr9[b-1]);
+ fprintf(fp, "%s", input_chr9[b-1]);
else
fprintf(fp, "%d", b-'0');
putc('\n', fp);
@@ -337,7 +337,7 @@ static void printkeymapping(FILE *fp, int keypress, int i)
if (s[0] > ' ')
putc(s[0], fp);
else if (s[0] < 10)
- fprintf(fp, input_chr9[s[0]-1]);
+ fprintf(fp, "%s", input_chr9[s[0]-1]);
else
fprintf(fp, "%d", s[0]);
putc('\n', fp);
diff --git a/src/cmdline.c b/src/cmdline.c
index ec9ba73..32929c6 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -357,7 +357,7 @@ static void print_hiscorelist()
else {
printf(" Name Score Lvl Lines\n");
gethiscorelist(buf);
- printf(buf);
+ printf("%s", buf);
}
}