]> git.llucax.com Git - z.facultad/75.06/emufs.git/blobdiff - tipo3/emufs.c
un change mas en la extension
[z.facultad/75.06/emufs.git] / tipo3 / emufs.c
index 49cb4b402d925a6f5e33ff5b89b55538cc841314..4d7409706876cf9b249ad81d182ecb619c811058 100644 (file)
@@ -9,8 +9,9 @@
 
 char *str_dup(const char *s)
 {
 
 char *str_dup(const char *s)
 {
+       char *tmp;
        if (s == NULL) return NULL;
        if (s == NULL) return NULL;
-       char *tmp = (char *)malloc(sizeof(char)*(strlen(s)+1));
+       tmp = (char *)malloc(sizeof(char)*(strlen(s)+1));
        strcpy(tmp, s);
        return tmp;
 }
        strcpy(tmp, s);
        return tmp;
 }
@@ -145,13 +146,13 @@ int ver_archivo_FS(EMUFS *emu)
 
        /* Imprimo la lista de bloques/registros */
        strcpy(name_f_block_free,emu->nombre);
 
        /* Imprimo la lista de bloques/registros */
        strcpy(name_f_block_free,emu->nombre);
-       strcat(name_f_block_free,".id3");
+       strcat(name_f_block_free,".idx");
        {
                BLOCK_REG_T r;
                f_block_free = fopen(name_f_block_free, "r");
                fread(&r, sizeof(BLOCK_REG_T), 1, f_block_free);
                while (!feof(f_block_free)) {
        {
                BLOCK_REG_T r;
                f_block_free = fopen(name_f_block_free, "r");
                fread(&r, sizeof(BLOCK_REG_T), 1, f_block_free);
                while (!feof(f_block_free)) {
-                       printf("ID %d en bloque %d\n", r.id_reg, r.block);
+                       printf("ID %ld en bloque %d\n", r.id_reg, r.block);
                        fread(&r, sizeof(BLOCK_REG_T), 1, f_block_free);
                }
                fclose(f_block_free);
                        fread(&r, sizeof(BLOCK_REG_T), 1, f_block_free);
                }
                fclose(f_block_free);