]> git.llucax.com Git - z.facultad/75.06/emufs.git/blobdiff - emufs/indice_b.c
retoques previos a la entrega. (que peligro :-D)
[z.facultad/75.06/emufs.git] / emufs / indice_b.c
index a964608e9b3f4ce8d18af1c960bd9679e43011dd..228ed2b5bbc1b86a273fe05b4cc2148ea80c6874 100644 (file)
@@ -1283,10 +1283,13 @@ CLAVE emufs_indice_b_obtener_sig_clave(INDICE *idx, CLAVE k)
                                                 */
                                                nodo = b_leer_nodo(idx, claves[header.cant-1].hijo_derecho);
                                                free(tmp);
-                                               b_leer_header(nodo, &header);
-                                               claves = b_leer_claves(nodo, &header);
+                                               if (nodo != NULL) {
+                                                       b_leer_header(nodo, &header);
+                                                       claves = b_leer_claves(nodo, &header);
 
-                                               salida = claves[0].clave;
+                                                       salida = claves[0].clave;
+                                               } else
+                                                       salida.i_clave = -1;
                                        }
                                        return salida;
                                }