1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
--- main.c.old 2002-11-17 23:56:12.000000000 +0100
+++ main.c 2004-10-29 22:32:00.000000000 +0200
@@ -459,7 +459,7 @@ FILE *hs_fopen(char *mode) {/*{{{*/
else {
char s[1024];
umask(0177);
- sprintf(s,"%s/.rockdodger_high",getenv("HOME"));
+ snprintf(s,1024,"%s/.rockdodger_high",getenv("HOME"));
if (f=fopen(s,mode)) {
umask(mask);
return f;
@@ -478,7 +478,7 @@ void read_high_score_table() {/*{{{*/
for (i=0; i<8; i++) {
char s[1024];
int highscore;
- if (fscanf (f, "%d %[^\n]", &highscore, s)!=2)
+ if (fscanf (f, "%d %1023[^\n]", &highscore, s)!=2)
break;
if (high[i].allocated)
free(high[i].name);
|