summaryrefslogtreecommitdiff
path: root/sys/src/games
diff options
context:
space:
mode:
authoraiju <devnull@localhost>2014-09-30 13:07:36 +0200
committeraiju <devnull@localhost>2014-09-30 13:07:36 +0200
commit4f264cedfbb6a10a9a471c8a11b2a80489e4287f (patch)
treef5fa7dc76d6c7341d475f3de18c0c7312bd0a27f /sys/src/games
parent4f4d71b941e568b158da73978e25105b94afd7fd (diff)
added crc32
Diffstat (limited to 'sys/src/games')
-rw-r--r--sys/src/games/gba/gba.c4
-rw-r--r--sys/src/games/snes/snes.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/sys/src/games/gba/gba.c b/sys/src/games/gba/gba.c
index dd417f432..d7b889ff9 100644
--- a/sys/src/games/gba/gba.c
+++ b/sys/src/games/gba/gba.c
@@ -198,8 +198,8 @@ loadrom(char *file)
if(fd < 0)
sysfatal("open: %r");
sz = seek(fd, 0, 2);
- if(sz <= 0 || sz >= 32*1024*1024)
- sysfatal("nope.jpg");
+ if(sz <= 0 || sz > 32*1024*1024)
+ sysfatal("invalid file size");
seek(fd, 0, 0);
nrom = sz;
rom = emalloc(nrom);
diff --git a/sys/src/games/snes/snes.c b/sys/src/games/snes/snes.c
index 9cd273200..ebb99d714 100644
--- a/sys/src/games/snes/snes.c
+++ b/sys/src/games/snes/snes.c
@@ -95,6 +95,7 @@ loadbat(char *file)
char *s;
if(battery && nsram != 0){
+ buf[sizeof buf - 1] = 0;
strncpy(buf, file, sizeof buf - 5);
s = buf + strlen(buf) - 4;
if(s < buf || strcmp(s, ".smc") != 0)