X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/ee1e9c0b0bf3af3579980b6cda4237efbc37e876..c4b24cdb8c9c9c83ad2b4cad26560b3487d15bd7:/emufs/tipo1.c diff --git a/emufs/tipo1.c b/emufs/tipo1.c index 4ef7f76..769d7b2 100644 --- a/emufs/tipo1.c +++ b/emufs/tipo1.c @@ -176,6 +176,7 @@ EMUFS_REG_ID emufs_tipo1_grabar_registro(EMUFS* efs, void* reg, if (block_id == EMUFS_NOT_FOUND) { /* crear un nuevo bloque en memoria */ block = (char*) malloc(efs->tam_bloque); + memset(block, 0, efs->tam_bloque); if (block == NULL) { /* TODO Manejo de errores */ PERR("No hay memoria"); @@ -388,6 +389,7 @@ void* emufs_tipo1_leer_registro_raw(EMUFS *efs, EMUFS_REG_ID id, EMUFS_REG_SIZE offset += curr_reg_size; } while (offset < block_size); + (*size) = efs->tam_bloque; return block; }