Commit b599f89a authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

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.
parent beccf375
...@@ -8,9 +8,6 @@ This is minesweeper for wine... ...@@ -8,9 +8,6 @@ This is minesweeper for wine...
Enjoy. I wrote it because it rhymes ;). Enjoy. I wrote it because it rhymes ;).
KNOWN BUGS: KNOWN BUGS:
Chokes on fastest times names greater than 16 characters long, must have
something to do with GetDlgItemText.
No help file. No help file.
Starting a new game causes the window to drop one pixel (Peter Hunnisett) Starting a new game causes the window to drop one pixel (Peter Hunnisett)
......
...@@ -277,7 +277,7 @@ void LoadBoard( BOARD *p_board ) ...@@ -277,7 +277,7 @@ void LoadBoard( BOARD *p_board )
DWORD size; DWORD size;
DWORD type; DWORD type;
HKEY hkey; HKEY hkey;
char data[16]; char data[MAX_PLAYER_NAME_SIZE+1];
char key_name[8]; char key_name[8];
unsigned i; unsigned i;
...@@ -327,7 +327,7 @@ void LoadBoard( BOARD *p_board ) ...@@ -327,7 +327,7 @@ void LoadBoard( BOARD *p_board )
(LPDWORD) &size ) == ERROR_SUCCESS ) (LPDWORD) &size ) == ERROR_SUCCESS )
lstrcpynA( p_board->best_name[i], data, sizeof(p_board->best_name[i]) ); lstrcpynA( p_board->best_name[i], data, sizeof(p_board->best_name[i]) );
else 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++ ) { for( i = 0; i < 3; i++ ) {
...@@ -345,7 +345,7 @@ void SaveBoard( BOARD *p_board ) ...@@ -345,7 +345,7 @@ void SaveBoard( BOARD *p_board )
{ {
HKEY hkey; HKEY hkey;
unsigned i; unsigned i;
char data[16]; char data[MAX_PLAYER_NAME_SIZE+1];
char key_name[8]; char key_name[8];
if( RegCreateKeyEx( HKEY_CURRENT_USER, registry_key, if( RegCreateKeyEx( HKEY_CURRENT_USER, registry_key,
......
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
#define FACE_WIDTH 24 #define FACE_WIDTH 24
#define FACE_HEIGHT 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 { SPRESS_BMP, COOL_BMP, DEAD_BMP, OOH_BMP, SMILE_BMP } FACE_BMP;
typedef enum { WAITING, PLAYING, GAMEOVER, WON } GAME_STATUS; typedef enum { WAITING, PLAYING, GAMEOVER, WON } GAME_STATUS;
...@@ -84,7 +86,7 @@ typedef struct tagBOARD ...@@ -84,7 +86,7 @@ typedef struct tagBOARD
unsigned rows; unsigned rows;
unsigned cols; unsigned cols;
unsigned mines; unsigned mines;
char best_name [3][16]; char best_name [3][MAX_PLAYER_NAME_SIZE+1];
DWORD best_time [3]; DWORD best_time [3];
DIFFICULTY difficulty; DIFFICULTY difficulty;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment