From 5cdd920d1267a7548ab492864c4a20a20c3d93ff Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Sun, 6 Dec 2009 13:52:28 +0000 Subject: Correct checking return value of open in plugins. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23874 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/chessbox/chessbox_pgn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/plugins/chessbox/chessbox_pgn.c') 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); -- cgit v1.2.3