Skip to content

Commit

Permalink
enforce defining main address before defining areas
Browse files Browse the repository at this point in the history
  • Loading branch information
dukelsky committed Dec 5, 2019
1 parent 872f52b commit 23a7cd1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cvsdate.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
char cvs_date[]="2019-01-08";
char cvs_date[]="2019-12-05";
2 changes: 1 addition & 1 deletion fidoconf.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%define reldate 20190311
%define reldate 20191205
%define reltype C
# may be one of: C (current), R (release), S (stable)

Expand Down
20 changes: 20 additions & 0 deletions src/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ void printLinkError(void)
exit(EX_CONFIG);
}

void printAddrError(void)
{
prErr("The main address must be defined before any areas!");
exit(EX_CONFIG);
}

s_link *getDescrLink(s_fidoconfig *config)
{
if (config->describeLinkDefaults) { /* describing defaults for links */
Expand Down Expand Up @@ -1803,6 +1809,11 @@ int parseEchoArea(char *token, s_fidoconfig *config)
{
int rc;
s_area *area;

if (config->addr == NULL)
{
printAddrError();
}
if (token == NULL) {
prErr("Parameters after %s are missing!", actualKeyword);
return 1;
Expand All @@ -1820,6 +1831,11 @@ int parseNetMailArea(char *token, s_fidoconfig *config)
{
int rc;
s_area *area;

if (config->addr == NULL)
{
printAddrError();
}
if (token == NULL) {
prErr("Parameters after %s are missing!", actualKeyword);
return 1;
Expand All @@ -1838,6 +1854,10 @@ int parseFileArea(char *token, s_fidoconfig *config)
int rc;
s_area *area;

if (config->addr == NULL)
{
printAddrError();
}
if (token == NULL) {
prErr("Parameters after %s are missing!", actualKeyword);
return 1;
Expand Down

0 comments on commit 23a7cd1

Please sign in to comment.