summaryrefslogtreecommitdiff
path: root/apps/plugins/chessbox/chessbox_pgn.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-12-06 13:52:28 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-12-06 13:52:28 +0000
commit5cdd920d1267a7548ab492864c4a20a20c3d93ff (patch)
tree518ddb3cbbf4eabcb8ca0941e386a285c56b53bb /apps/plugins/chessbox/chessbox_pgn.c
parente760a5abbf951fd22e1dd8eb116e344ad3d76a61 (diff)
downloadrockbox-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/chessbox/chessbox_pgn.c')
-rw-r--r--apps/plugins/chessbox/chessbox_pgn.c4
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){
564 int line_count = 0; 564 int line_count = 0;
565 bool header_start = true, game_start = false; 565 bool header_start = true, game_start = false;
566 566
567 if ( (fhandler = rb->open(filename, O_RDONLY)) == 0 ) return NULL; 567 if ( (fhandler = rb->open(filename, O_RDONLY)) < 0 ) return NULL;
568 568
569 if (bufptr == NULL){ 569 if (bufptr == NULL){
570 pl_malloc_init(); 570 pl_malloc_init();
@@ -572,7 +572,7 @@ struct pgn_game_node* pgn_list_games(const char* filename){
572 while (rb->read_line(fhandler, line_buffer, sizeof line_buffer) > 0){ 572 while (rb->read_line(fhandler, line_buffer, sizeof line_buffer) > 0){
573 line_count++; 573 line_count++;
574 /* looking for a game header */ 574 /* looking for a game header */
575 if (header_start) { 575 if (header_start) {
576 /* a new game header is found */ 576 /* a new game header is found */
577 if (line_buffer[0] == '['){ 577 if (line_buffer[0] == '['){
578 temp_node = (struct pgn_game_node *)pl_malloc(sizeof size_node); 578 temp_node = (struct pgn_game_node *)pl_malloc(sizeof size_node);