winemine: Increased buffer size for player names.

Player names can be 31 characters long in Windows, so winemine should
now be able to read any of the player names in the registry created from
the minesweeper in the native Windows.
This commit is contained in:
Dylan Smith 2008-06-24 14:09:54 -04:00 committed by Alexandre Julliard
parent beccf37586
commit b599f89abe
3 changed files with 6 additions and 7 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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;