Commit 9377ea99 authored by Alexandre Julliard's avatar Alexandre Julliard

Pass the correct string length to RegSetValueExA.

parent 918da64a
...@@ -384,47 +384,38 @@ void SaveBoard( BOARD *p_board ) ...@@ -384,47 +384,38 @@ void SaveBoard( BOARD *p_board )
REG_OPTION_NON_VOLATILE, KEY_WRITE, &sa, REG_OPTION_NON_VOLATILE, KEY_WRITE, &sa,
&hkey, &disp ) != ERROR_SUCCESS) &hkey, &disp ) != ERROR_SUCCESS)
return; return;
wsprintf( data, "%d", p_board->pos.x ); wsprintf( data, "%d", p_board->pos.x );
RegSetValueEx( hkey, "Xpos", 0, REG_SZ, (LPBYTE) data, RegSetValueEx( hkey, "Xpos", 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
sizeof( data ));
wsprintf( data, "%d", p_board->pos.x ); wsprintf( data, "%d", p_board->pos.x );
RegSetValueEx( hkey, "Ypos", 0, REG_SZ, (LPBYTE) data, RegSetValueEx( hkey, "Ypos", 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
sizeof( data ));
wsprintf( data, "%d", (int) p_board->difficulty ); wsprintf( data, "%d", (int) p_board->difficulty );
RegSetValueEx( hkey, "Difficulty", 0, REG_SZ, (LPBYTE) data, RegSetValueEx( hkey, "Difficulty", 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
sizeof( data ));
wsprintf( data, "%d", p_board->rows ); wsprintf( data, "%d", p_board->rows );
RegSetValueEx( hkey, "Rows", 0, REG_SZ, (LPBYTE) data, RegSetValueEx( hkey, "Rows", 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
sizeof( data ));
wsprintf( data, "%d", p_board->cols ); wsprintf( data, "%d", p_board->cols );
RegSetValueEx( hkey, "Cols", 0, REG_SZ, (LPBYTE) data, RegSetValueEx( hkey, "Cols", 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
sizeof( data ));
wsprintf( data, "%d", p_board->mines ); wsprintf( data, "%d", p_board->mines );
RegSetValueEx( hkey, "Mines", 0, REG_SZ, (LPBYTE) data, RegSetValueEx( hkey, "Mines", 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
sizeof( data ));
wsprintf( data, "%d", (int) p_board->IsMarkQ ); wsprintf( data, "%d", (int) p_board->IsMarkQ );
RegSetValueEx( hkey, "MarkQ", 0, REG_SZ, (LPBYTE) data, RegSetValueEx( hkey, "MarkQ", 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
sizeof( data ));
for( i = 0; i < 3; i++ ) { for( i = 0; i < 3; i++ ) {
wsprintf( key_name, "Name%u", i ); wsprintf( key_name, "Name%u", i );
strncpy( data, p_board->best_name[i], sizeof( data ) ); strncpy( data, p_board->best_name[i], sizeof( data ) );
RegSetValueEx( hkey, key_name, 0, REG_SZ, (LPBYTE) data, RegSetValueEx( hkey, key_name, 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
sizeof( data ));
} }
for( i = 0; i < 3; i++ ) { for( i = 0; i < 3; i++ ) {
wsprintf( key_name, "Time%u", i ); wsprintf( key_name, "Time%u", i );
wsprintf( data, "%d", p_board->best_time[i] ); wsprintf( data, "%d", p_board->best_time[i] );
RegSetValueEx( hkey, key_name, 0, REG_SZ, (LPBYTE) data, RegSetValueEx( hkey, key_name, 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
sizeof( data ));
} }
RegCloseKey( hkey ); RegCloseKey( hkey );
} }
......
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