Skip to content

Commit 370389d

Browse files
sedmichaLukas Hutak
authored andcommitted
Iemgr: fix bug when loading aliases due to unsorted elements, change colliding error code
1 parent 79b96c9 commit 370389d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/iemgr/iemgr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ dir_read(fds_iemgr_t* mgr, const char* path, fds_xml_t* parser, const string& na
279279
}
280280
}
281281

282+
mgr_sort(mgr);
283+
282284
int rc;
283285

284286
rc = fds_iemgr_alias_read_file(mgr, (string(path) + "/" + string(name) + "/aliases.xml").c_str());

src/iemgr/iemgr_alias.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ read_source(fds_iemgr_t *mgr, fds_xml_ctx_t *xml_ctx, fds_iemgr_alias *alias)
373373
fds_iemgr_elem_find_name(mgr, cont->ptr_string);
374374
if (elem == nullptr) {
375375
mgr->err_msg = "No element with name " + std::string(cont->ptr_string);
376-
return FDS_ERR_NOTFOUND;
376+
return FDS_ERR_FORMAT;
377377
}
378378
if (!alias_add_source(alias, elem)) {
379379
mgr->err_msg = ERRMSG_NOMEM;

0 commit comments

Comments
 (0)