diff --git a/src/cargador.c b/src/cargador.c index d42e6df..3d8e35e 100644 --- a/src/cargador.c +++ b/src/cargador.c @@ -56,21 +56,18 @@ void uncompress_z80(FILE *fichero,int length,unsigned char *memo) { if(EDfound==2) { // we have two EDs counter=byte_loaded; - retval=fread(&byte_loaded,1,1,fichero); + retval=fread(&byte_loaded,1,1,fichero); //ED byte EDfound=0; continue; } if(byte_loaded==0xED) { - EDfound++; + if (position+1=length) { - break; - } memo[position++]=byte_loaded; } } while(position