Rev 4565 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4565 | Rev 4573 | ||
---|---|---|---|
Line 200... | Line 200... | ||
200 | { |
200 | { |
201 | FILE *f; |
201 | FILE *f; |
202 | size_t cnt; |
202 | size_t cnt; |
203 | int rc; |
203 | int rc; |
204 | 204 | ||
205 | f = fopen("/tetris.sco", "rb"); |
205 | f = fopen("/data/tetris.sco", "rb"); |
206 | if (f == NULL) |
206 | if (f == NULL) |
207 | return ENOENT; |
207 | return ENOENT; |
208 | 208 | ||
209 | cnt = fread(scores, sizeof(struct highscore), NUMSPOTS, f); |
209 | cnt = fread(scores, sizeof(struct highscore), NUMSPOTS, f); |
210 | rc = fclose(f); |
210 | rc = fclose(f); |
Line 219... | Line 219... | ||
219 | { |
219 | { |
220 | FILE *f; |
220 | FILE *f; |
221 | size_t cnt; |
221 | size_t cnt; |
222 | int rc; |
222 | int rc; |
223 | 223 | ||
224 | f = fopen("/tetris.sco", "wb"); |
224 | f = fopen("/data/tetris.sco", "wb"); |
225 | cnt = fwrite(scores, sizeof(struct highscore), NUMSPOTS, f); |
225 | cnt = fwrite(scores, sizeof(struct highscore), NUMSPOTS, f); |
226 | rc = fclose(f); |
226 | rc = fclose(f); |
227 | 227 | ||
228 | if (cnt != NUMSPOTS || rc != 0) |
228 | if (cnt != NUMSPOTS || rc != 0) |
229 | printf("Error saving score table\n"); |
229 | printf("Error saving score table\n"); |