Skip to content

Instantly share code, notes, and snippets.

@rainest
Created February 6, 2014 17:42
Show Gist options
  • Save rainest/8849013 to your computer and use it in GitHub Desktop.
Save rainest/8849013 to your computer and use it in GitHub Desktop.
sm_marid_is_fqdn(sm_marid *context, char const *s)
{
int saw_dot = 0;
if (s == NULL || *s == '\0')
{
sm_marid_log(context, SM_MARID_LOG_FAIL,
"*** domain is %s ***",
s == NULL ? "null" : "empty");
return 0;
}
for (;;)
{
if (!FQDN_ISLETDIG(*s))
{
sm_marid_log(context, SM_MARID_LOG_FAIL,
"*** domain segment starts with '%c', which "
"is not a letter or digit ***", *s);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment