mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
Sync with MESS (no whatsnew)
This commit is contained in:
parent
cb3d823e86
commit
b1c3a23ed4
@ -139,7 +139,7 @@ static FLOPPY_IDENTIFY(apple2_dsk_identify)
|
||||
|
||||
if (size == expected_size)
|
||||
*vote = 100;
|
||||
else if (size - expected_size < 8 && size - expected_size > -8)
|
||||
else if (abs(size - expected_size) < 8)
|
||||
*vote = 90; /* tolerate images with up to eight fewer/extra bytes (bug #638) */
|
||||
else
|
||||
*vote = 0;
|
||||
|
@ -81,7 +81,7 @@ static void tzx_cas_get_blocks( const UINT8 *casdata, int caslen )
|
||||
int pos = sizeof(TZX_HEADER) + 2;
|
||||
int max_block_count = INITIAL_MAX_BLOCK_COUNT;
|
||||
|
||||
blocks = (UINT8**)malloc(max_block_count);
|
||||
blocks = (UINT8**)malloc(max_block_count * sizeof(UINT8*));
|
||||
memset(blocks,0,max_block_count);
|
||||
block_count = 0;
|
||||
|
||||
@ -94,9 +94,8 @@ static void tzx_cas_get_blocks( const UINT8 *casdata, int caslen )
|
||||
{
|
||||
void *old_blocks = blocks;
|
||||
int old_max_block_count = max_block_count;
|
||||
printf("realoc");
|
||||
max_block_count = max_block_count + BLOCK_COUNT_INCREMENTS;
|
||||
blocks = (UINT8**)malloc(max_block_count); // SHOULD NOT BE USING auto_alloc_array()
|
||||
blocks = (UINT8**)malloc(max_block_count * sizeof(UINT8*)); // SHOULD NOT BE USING auto_alloc_array()
|
||||
memset(blocks,0,max_block_count);
|
||||
memcpy(blocks, old_blocks, old_max_block_count * sizeof(UINT8*));
|
||||
if (blocks) free(old_blocks);
|
||||
|
Loading…
Reference in New Issue
Block a user