summaryrefslogtreecommitdiffstats
path: root/apps/plugins/chessbox/chessbox_pgn.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2008-04-09 15:25:17 +0000
committerNils Wallménius <nils@rockbox.org>2008-04-09 15:25:17 +0000
commit6848961aa5f93a290917071ff3496e1d5026621b (patch)
tree70d377348ab0694c356fffd9fe25f095ccbe88fe /apps/plugins/chessbox/chessbox_pgn.c
parentae64d2602befd5589c8c0141a6d812841fdfb232 (diff)
downloadrockbox-6848961aa5f93a290917071ff3496e1d5026621b.tar.gz
rockbox-6848961aa5f93a290917071ff3496e1d5026621b.zip
Pass the buffer length to the list_get_name callback functions instead of using hardcoded MAX_PATH
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17049 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chessbox/chessbox_pgn.c')
-rw-r--r--apps/plugins/chessbox/chessbox_pgn.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c
index 6d18986f95..94bda2eaaa 100644
--- a/apps/plugins/chessbox/chessbox_pgn.c
+++ b/apps/plugins/chessbox/chessbox_pgn.c
@@ -527,7 +527,8 @@ void coords_to_pgn(struct pgn_ply_node* ply){
}
}
-char * get_game_text(int selected_item, void *data, char *buffer){
+char * get_game_text(int selected_item, void *data,
+ char *buffer, size_t buffer_len){
int i;
struct pgn_game_node *temp_node = (struct pgn_game_node *)data;
char text_buffer[50];
@@ -541,7 +542,7 @@ char * get_game_text(int selected_item, void *data, char *buffer){
rb->snprintf(text_buffer, 50,"%s vs. %s (%s)", temp_node->white_player,
temp_node->black_player, temp_node->game_date);
- rb->strcpy(buffer, text_buffer);
+ rb->strncpy(buffer, text_buffer, buffer_len);
return buffer;
}