changing manual list size entry for allowed funcs in server update mode

This commit is contained in:
maliakal_d 2022-02-23 09:12:51 +01:00
parent c14fb92c16
commit 11ad019d47

View File

@ -80,7 +80,7 @@ char scanErrMessage[MAX_STR_LENGTH] = "";
/* initialization functions */
int updateModeAllowedFunction(int file_des) {
enum detFuncs list[] = {F_EXEC_COMMAND,
enum detFuncs allowedFuncs[] = {F_EXEC_COMMAND,
F_GET_DETECTOR_TYPE,
F_GET_FIRMWARE_VERSION,
F_GET_SERVER_VERSION,
@ -102,10 +102,10 @@ int updateModeAllowedFunction(int file_des) {
F_GET_NUM_CHANNELS,
F_GET_NUM_INTERFACES,
F_ACTIVATE};
unsigned int listsize = 22;
size_t allowedFuncsSize = sizeof(allowedFuncs) / sizeof(enum detFuncs);
for (unsigned int i = 0; i < listsize; ++i) {
if ((unsigned int)fnum == list[i]) {
for (unsigned int i = 0; i < allowedFuncsSize; ++i) {
if ((unsigned int)fnum == allowedFuncs[i]) {
return OK;
}
}