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/chessbox | |
parent | e760a5abbf951fd22e1dd8eb116e344ad3d76a61 (diff) |
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/chessbox')
-rw-r--r-- | apps/plugins/chessbox/chessbox_pgn.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c index 512fb0ca15..a165e3ee8c 100644 --- a/apps/plugins/chessbox/chessbox_pgn.c +++ b/apps/plugins/chessbox/chessbox_pgn.c @@ -564,7 +564,7 @@ struct pgn_game_node* pgn_list_games(const char* filename){ int line_count = 0; bool header_start = true, game_start = false; - if ( (fhandler = rb->open(filename, O_RDONLY)) == 0 ) return NULL; + if ( (fhandler = rb->open(filename, O_RDONLY)) < 0 ) return NULL; if (bufptr == NULL){ pl_malloc_init(); @@ -572,7 +572,7 @@ struct pgn_game_node* pgn_list_games(const char* filename){ while (rb->read_line(fhandler, line_buffer, sizeof line_buffer) > 0){ line_count++; /* looking for a game header */ - if (header_start) { + if (header_start) { /* a new game header is found */ if (line_buffer[0] == '['){ temp_node = (struct pgn_game_node *)pl_malloc(sizeof size_node); |