diff --git a/programs/winemine/README b/programs/winemine/README index e3649357709..711b5f9c1e3 100644 --- a/programs/winemine/README +++ b/programs/winemine/README @@ -8,9 +8,6 @@ This is minesweeper for wine... Enjoy. I wrote it because it rhymes ;). KNOWN BUGS: - Chokes on fastest times names greater than 16 characters long, must have - something to do with GetDlgItemText. - No help file. Starting a new game causes the window to drop one pixel (Peter Hunnisett) diff --git a/programs/winemine/main.c b/programs/winemine/main.c index 13311c789c7..a8ea08ec7eb 100644 --- a/programs/winemine/main.c +++ b/programs/winemine/main.c @@ -277,7 +277,7 @@ void LoadBoard( BOARD *p_board ) DWORD size; DWORD type; HKEY hkey; - char data[16]; + char data[MAX_PLAYER_NAME_SIZE+1]; char key_name[8]; unsigned i; @@ -327,7 +327,7 @@ void LoadBoard( BOARD *p_board ) (LPDWORD) &size ) == ERROR_SUCCESS ) lstrcpynA( p_board->best_name[i], data, sizeof(p_board->best_name[i]) ); else - LoadString( p_board->hInst, IDS_NOBODY, p_board->best_name[i], 16 ); + LoadString( p_board->hInst, IDS_NOBODY, p_board->best_name[i], MAX_PLAYER_NAME_SIZE+1 ); } for( i = 0; i < 3; i++ ) { @@ -345,7 +345,7 @@ void SaveBoard( BOARD *p_board ) { HKEY hkey; unsigned i; - char data[16]; + char data[MAX_PLAYER_NAME_SIZE+1]; char key_name[8]; if( RegCreateKeyEx( HKEY_CURRENT_USER, registry_key, diff --git a/programs/winemine/main.h b/programs/winemine/main.h index 16fcb2e019d..a813c95f04a 100644 --- a/programs/winemine/main.h +++ b/programs/winemine/main.h @@ -45,6 +45,8 @@ #define FACE_WIDTH 24 #define FACE_HEIGHT 24 +#define MAX_PLAYER_NAME_SIZE 31 + typedef enum { SPRESS_BMP, COOL_BMP, DEAD_BMP, OOH_BMP, SMILE_BMP } FACE_BMP; typedef enum { WAITING, PLAYING, GAMEOVER, WON } GAME_STATUS; @@ -84,7 +86,7 @@ typedef struct tagBOARD unsigned rows; unsigned cols; unsigned mines; - char best_name [3][16]; + char best_name [3][MAX_PLAYER_NAME_SIZE+1]; DWORD best_time [3]; DIFFICULTY difficulty;