Skip to content
Snippets Groups Projects
Commit a8cf3669 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix unsigned compare against >= 0 and nomatch misplacement

I'm not clear if/why these would cause the issue reporetd by
Fernando but they're definitely bugs in the areas.ini areafix
code. No impact to the areas.bbs areafix handling.
parent 3f24e009
Branches
Tags
No related merge requests found
Pipeline #7211 passed
......@@ -1587,7 +1587,6 @@ void alter_areas_ini(FILE* afilein, FILE* afileout, FILE* nmfile
,nodecfg_t* nodecfg, const char* to, bool rescan)
{
bool nomatch = false;
unsigned j;
faddr_t addr = nodecfg->addr;
const char* addr_str = smb_faddrtoa(&addr,NULL);
size_t add_count;
......@@ -1635,10 +1634,10 @@ void alter_areas_ini(FILE* afilein, FILE* afileout, FILE* nmfile
}
if(add_count) { /* Check for areas to add */
bool add_all = (stricmp(add_area[0], "+ALL") == 0);
j = strListFind(add_area, echotag, /* case-sensitive */false);
if(add_all || j >= 0) {
if(j >= 0)
add_area[j][0]=0; /* So we can check other lists */
int add_index = strListFind(add_area, echotag, /* case-sensitive */false);
if(add_all || add_index >= 0) {
if(add_index >= 0)
add_area[add_index][0]=0; /* So we can check other lists */
uint areanum = find_area(echotag);
if(!area_is_valid(areanum)) {
lprintf(LOG_ERR, "Invalid area num on line %d", __LINE__);
......@@ -1670,9 +1669,9 @@ void alter_areas_ini(FILE* afilein, FILE* afileout, FILE* nmfile
}
continue;
}
}
nomatch = true; /* This area wasn't in there */
}
}
strListWriteFile(afileout, ini, "\n");
strListFree(&ini);
strListFree(&areas);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment