diff options
author | Nils Wallménius <nils@rockbox.org> | 2009-07-14 13:57:45 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2009-07-14 13:57:45 +0000 |
commit | 3d4701a6e41616cf581a297bab1451cf2db70249 (patch) | |
tree | f845837c96ffbed7d59ddf8308f3b3e7c40cb8c9 /apps/plugins/sudoku | |
parent | c2900a1bacd5d98b57a0d15ea2add1bc08764057 (diff) | |
download | rockbox-3d4701a6e41616cf581a297bab1451cf2db70249.tar.gz rockbox-3d4701a6e41616cf581a297bab1451cf2db70249.zip |
FS#10080
* Move strncpy() from core to the pluginlib
* Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins
* Drop strncpy() from the codec api as no codec used it
* Bump codec and plugin api versions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/sudoku')
-rw-r--r-- | apps/plugins/sudoku/sudoku.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c index f8a438592d..77f6ca7899 100644 --- a/apps/plugins/sudoku/sudoku.c +++ b/apps/plugins/sudoku/sudoku.c | |||
@@ -603,7 +603,7 @@ void default_state(struct sudoku_state_t* state) | |||
603 | { | 603 | { |
604 | int r,c; | 604 | int r,c; |
605 | 605 | ||
606 | rb->strncpy(state->filename,GAME_FILE,MAX_PATH); | 606 | rb->strlcpy(state->filename,GAME_FILE,MAX_PATH); |
607 | for (r=0;r<9;r++) { | 607 | for (r=0;r<9;r++) { |
608 | for (c=0;c<9;c++) { | 608 | for (c=0;c<9;c++) { |
609 | state->startboard[r][c]=default_game[r][c]; | 609 | state->startboard[r][c]=default_game[r][c]; |
@@ -626,7 +626,7 @@ void clear_state(struct sudoku_state_t* state) | |||
626 | { | 626 | { |
627 | int r,c; | 627 | int r,c; |
628 | 628 | ||
629 | rb->strncpy(state->filename,GAME_FILE,MAX_PATH); | 629 | rb->strlcpy(state->filename,GAME_FILE,MAX_PATH); |
630 | for (r=0;r<9;r++) { | 630 | for (r=0;r<9;r++) { |
631 | for (c=0;c<9;c++) { | 631 | for (c=0;c<9;c++) { |
632 | state->startboard[r][c]='0'; | 632 | state->startboard[r][c]='0'; |
@@ -719,7 +719,7 @@ bool load_sudoku(struct sudoku_state_t* state, char* filename) | |||
719 | return(false); | 719 | return(false); |
720 | } | 720 | } |
721 | 721 | ||
722 | rb->strncpy(state->filename,filename,MAX_PATH); | 722 | rb->strlcpy(state->filename,filename,MAX_PATH); |
723 | n=rb->read(fd,buf,300); | 723 | n=rb->read(fd,buf,300); |
724 | if (n <= 0) { | 724 | if (n <= 0) { |
725 | return(false); | 725 | return(false); |
@@ -1111,7 +1111,7 @@ bool sudoku_generate(struct sudoku_state_t* state) | |||
1111 | rb->snprintf(str,sizeof(str),"Difficulty: %s",difficulty); | 1111 | rb->snprintf(str,sizeof(str),"Difficulty: %s",difficulty); |
1112 | display_board(state); | 1112 | display_board(state); |
1113 | rb->splash(HZ*3, str); | 1113 | rb->splash(HZ*3, str); |
1114 | rb->strncpy(state->filename,GAME_FILE,MAX_PATH); | 1114 | rb->strlcpy(state->filename,GAME_FILE,MAX_PATH); |
1115 | } else { | 1115 | } else { |
1116 | display_board(&new_state); | 1116 | display_board(&new_state); |
1117 | rb->splash(HZ*2, "Aborted"); | 1117 | rb->splash(HZ*2, "Aborted"); |