File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -637,13 +637,10 @@ int32 CFE_ES_UnlockCDSRegistry(void)
637637int32 CFE_ES_FindCDSInRegistry (const char * CDSName )
638638{
639639 int32 RegIndx = CFE_ES_CDS_NOT_FOUND ;
640- int32 i = -1 ;
640+ uint32 i = 0 ;
641641
642- do
642+ while ( ( RegIndx == CFE_ES_CDS_NOT_FOUND ) && ( i < CFE_ES_Global . CDSVars . MaxNumRegEntries ) )
643643 {
644- /* Point to next record in the CDS Registry */
645- i ++ ;
646-
647644 /* Check to see if the record is currently being used */
648645 if (CFE_ES_Global .CDSVars .Registry [i ].Taken == true)
649646 {
@@ -654,7 +651,11 @@ int32 CFE_ES_FindCDSInRegistry(const char *CDSName)
654651 RegIndx = i ;
655652 }
656653 }
657- } while ( (RegIndx == CFE_ES_CDS_NOT_FOUND ) && (i < (CFE_ES_Global .CDSVars .MaxNumRegEntries - 1 )) );
654+
655+ /* Point to next record in the CDS Registry */
656+ i ++ ;
657+
658+ };
658659
659660 return RegIndx ;
660661} /* End of CFE_ES_FindCDSInRegistry() */
@@ -670,7 +671,7 @@ int32 CFE_ES_FindCDSInRegistry(const char *CDSName)
670671int32 CFE_ES_FindFreeCDSRegistryEntry (void )
671672{
672673 int32 RegIndx = CFE_ES_CDS_NOT_FOUND ;
673- int32 i = 0 ;
674+ uint32 i = 0 ;
674675
675676 while ( (RegIndx == CFE_ES_CDS_NOT_FOUND ) && (i < CFE_ES_Global .CDSVars .MaxNumRegEntries ) )
676677 {
You can’t perform that action at this time.
0 commit comments