Wrong return-value from basic/object /calendar.c #1014
Closed
maimomohali
started this conversation in
General
Replies: 1 comment
-
|
Thank you for reporting the problem. I created issue [#1015] to track and pull request [#1016] to fix the usage of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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.
/**
*/
Beta Was this translation helpful? Give feedback.
All reactions