diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2009-12-06 13:52:28 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2009-12-06 13:52:28 +0000 |
commit | 5cdd920d1267a7548ab492864c4a20a20c3d93ff (patch) | |
tree | 518ddb3cbbf4eabcb8ca0941e386a285c56b53bb /apps/plugins/chip8.c | |
parent | e760a5abbf951fd22e1dd8eb116e344ad3d76a61 (diff) | |
download | rockbox-5cdd920d1267a7548ab492864c4a20a20c3d93ff.tar.gz rockbox-5cdd920d1267a7548ab492864c4a20a20c3d93ff.zip |
Correct checking return value of open in plugins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23874 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chip8.c')
-rw-r--r-- | apps/plugins/chip8.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c index 3bdf95093a..7435518855 100644 --- a/apps/plugins/chip8.c +++ b/apps/plugins/chip8.c | |||
@@ -1329,7 +1329,7 @@ static bool chip8_init(const char* file) | |||
1329 | int i; | 1329 | int i; |
1330 | 1330 | ||
1331 | fd = rb->open(file, O_RDONLY); | 1331 | fd = rb->open(file, O_RDONLY); |
1332 | if (fd==-1) { | 1332 | if (fd < 0) { |
1333 | rb->lcd_puts(0, 6, "File Error."); | 1333 | rb->lcd_puts(0, 6, "File Error."); |
1334 | return false; | 1334 | return false; |
1335 | } | 1335 | } |
@@ -1351,7 +1351,7 @@ static bool chip8_init(const char* file) | |||
1351 | c8kname[len-2] = '8'; | 1351 | c8kname[len-2] = '8'; |
1352 | c8kname[len-1] = 'k'; | 1352 | c8kname[len-1] = 'k'; |
1353 | fd = rb->open(c8kname, O_RDONLY); | 1353 | fd = rb->open(c8kname, O_RDONLY); |
1354 | if (fd!=-1) { | 1354 | if (fd >= 0) { |
1355 | rb->lcd_puts(0, 6, "File&Keymap OK."); | 1355 | rb->lcd_puts(0, 6, "File&Keymap OK."); |
1356 | numread = rb->read(fd, chip8_keymap, 16); | 1356 | numread = rb->read(fd, chip8_keymap, 16); |
1357 | rb->close(fd); | 1357 | rb->close(fd); |