Fix Index loop counting bugs in ND_DataStruct_Flush_I() and ND_Node_Root_Alloc()...

This commit is contained in:
agibert 2002-02-26 16:38:19 +00:00
parent e56381b50e
commit 1f50073641

View File

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $RCSfile: libnode.c,v $ */ /* $RCSfile: libnode.c,v $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* $Revision: 2.1 $ */ /* $Revision: 2.2 $ */
/* $Name: $ */ /* $Name: $ */
/* $Date: 2002/02/25 23:34:36 $ */ /* $Date: 2002/02/26 16:38:19 $ */
/* $Author: agibert $ */ /* $Author: agibert $ */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -12,7 +12,7 @@
#include <libnode.h> #include <libnode.h>
#ifdef _LIBVER #ifdef _LIBVER
VER_INFO_EXPORT (libnode,"$Revision: 2.1 $", "$Name: $",__FILE__,"$Author: agibert $") VER_INFO_EXPORT (libnode,"$Revision: 2.2 $", "$Name: $",__FILE__,"$Author: agibert $")
#endif #endif
@ -42,7 +42,7 @@ NDT_Status ND_Default_Manager( NDT_Root *Root_Ptr, NDT_Index_Id Index_Id, NDT
Command_Name = "NDD_CMD_MANAGER_VERSION"; Command_Name = "NDD_CMD_MANAGER_VERSION";
*Version_Name_Ptr = "$Revision: 2.1 $ $Name: $ $Date: 2002/02/25 23:34:36 $ $Author: agibert $"; *Version_Name_Ptr = "$Revision: 2.2 $ $Name: $ $Date: 2002/02/26 16:38:19 $ $Author: agibert $";
return( NDS_OK); return( NDS_OK);
} }
@ -826,7 +826,7 @@ NDT_Status ND_DataStruct_Flush_I( NDT_Root *Root_Ptr)
NDT_Index_Id index_id; NDT_Index_Id index_id;
for( index_id = Root_Ptr->Index_Nb; index_id >= 0 ; index_id--) for( index_id = ( Root_Ptr->Index_Nb - 1); index_id >= 0 ; index_id--)
{ {
status = ND_Index_Flush_I( Root_Ptr, index_id); status = ND_Index_Flush_I( Root_Ptr, index_id);
if( ND_ERROR( status)) return( status); if( ND_ERROR( status)) return( status);
@ -3426,7 +3426,7 @@ NDT_Status ND_Node_Root_Alloc( NDT_Root **Root_Ptr_Ptr, NDT_Index_Nb Index_Nb,
(*Root_Ptr_Ptr)->Index_Nb = Index_Nb; (*Root_Ptr_Ptr)->Index_Nb = Index_Nb;
(*Root_Ptr_Ptr)->Index_Open_Count = 0; (*Root_Ptr_Ptr)->Index_Open_Count = 0;
for( index_id = 0; index_id <= Index_Nb; index_id++) for( index_id = 0; index_id < Index_Nb; index_id++)
{ {
(*Root_Ptr_Ptr)->Index_Tab[index_id].Type = NDD_INDEX_STATUS_CLOSED; (*Root_Ptr_Ptr)->Index_Tab[index_id].Type = NDD_INDEX_STATUS_CLOSED;