Merge pull request #6 from besser82/improvements

some minor improvements
This commit is contained in:
Tiehuis 2014-12-01 16:29:06 +13:00
commit 2fef5a4822
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/2048*

View File

@ -5,10 +5,10 @@ LIBS = -lcurses
all: 2048
2048: src/2048.c src/2048.h src/highscore_file.c
$(CC) $(CFLAGS) src/2048.c src/highscore_file.c -o 2048 $(LIBS)
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) src/2048.c src/highscore_file.c -o 2048
2048nc: src/2048_no_curses.c src/2048.h src/highscore_file.c
$(CC) $(CFLAGS) src/2048_no_curses.c src/highscore_file.c -o 2048nc
$(CC) $(CFLAGS) $(LDFLAGS) src/2048_no_curses.c src/highscore_file.c -o 2048nc
clean:
rm -f 2048 2048nc

View File

@ -163,7 +163,7 @@ int get_score_high() {
if (fd == NULL)
fd = fopen(HISCORE_FILE, "w+");
fscanf(fd, "%d", &s);
if (fscanf(fd, "%d", &s) == 1) {};
fclose(fd);
return s;
}