Skip to content

Commit

Permalink
Fix the wording on hostname validation
Browse files Browse the repository at this point in the history
  • Loading branch information
madolson committed Oct 26, 2021
1 parent b069160 commit 67022e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2365,11 +2365,13 @@ static int isValidAnnouncedHostname(char *val, const char **err) {
int i = 0;
char c;
while ((c = val[i])) {
/* We just validate the character set to make sure that everything
* is parsed and handled correctly. */
if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')
|| (c >= '0' && c <= '9') || (c == '-') || (c == '.')))
{
*err = "Hostnames may only contain alphanumeric characters "
"or hyphens";
*err = "Hostnames may only contain alphanumeric characters, "
"hyphens, or dots";
return 0;
}
c = val[i++];
Expand Down

0 comments on commit 67022e5

Please sign in to comment.