-
Notifications
You must be signed in to change notification settings - Fork 258
Description
Discussed in #1014
Originally posted by maimomohali June 9, 2025
Here is part of bacnet-stack/bacnet-stack/tree/master/src/bacnet/basic/object/calendar.c
Calendar_Date_List_Add`s return type is boolean
bool Calendar_Date_List_Add(uint32_t object_instance, const BACNET_CALENDAR_ENTRY *value)
{
bool st = false;
~~
st = Keylist_Data_Add(pObject->Date_List, Keylist_Count(pObject->Date_List), entry);
return st;
}
From /src/bacnet/basic/sys/keylist.c, Keylist_Data_Add`s return type is int
int Keylist_Data_Add(OS_Keylist list, KEY key, void *data) => return index..
Problem is this,
When "First" Data is added, [Keylist_Data_Add Return] has value , [0] (this mean first index is 0 ,also, mean successful adding)
But, 0 return (successful add) --> st --> Calendar_Date_List_Add` return 0 mean Fail add.
So,
I think [Below explanation & Calendar_Date_List_Add`s return judge ] need some fix.
/**