summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2007-10-29 23:20:45 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2007-10-29 23:20:45 (GMT)
commit13ae7323003334393343dfedac03c75e51c22be9 (patch) (side-by-side diff)
tree583ed1f3304867935e52c493ebc608f6ed49172c
parent6624b845b4f02110dd1068582d3e11956a76d91b (diff)
downloadmailfromd-13ae7323003334393343dfedac03c75e51c22be9.tar.gz
mailfromd-13ae7323003334393343dfedac03c75e51c22be9.tar.bz2
(domain_name_cmp): Yet another bugfix
git-svn-id: file:///svnroot/mailfromd/trunk@1525 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/dnsbase.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/dnsbase.c b/src/dnsbase.c
index 28c8898..3d06316 100644
--- a/src/dnsbase.c
+++ b/src/dnsbase.c
@@ -273,18 +273,20 @@ domain_name_cmp(const char *ptr, const char *name, const char *domain)
while (*name && *ptr)
if (c = *ptr++ - *name++)
return c;
- if (*domain && *ptr != '.')
- return *ptr - *domain;
- ptr++;
- while (*domain && *ptr)
- if (c = *ptr++ - *domain++)
- return c;
- if (*domain == '.' && domain[1] == 0)
- domain++;
- if (*ptr == '.' && ptr[1] == 0)
+ if (*domain) {
+ if (*ptr != '.')
+ return *ptr - *domain;
ptr++;
- if (*domain || *ptr)
- return 1;
+ while (*domain && *ptr)
+ if (c = *ptr++ - *domain++)
+ return c;
+ if (*domain == '.' && domain[1] == 0)
+ domain++;
+ if (*ptr == '.' && ptr[1] == 0)
+ ptr++;
+ if (*domain || *ptr)
+ return 1;
+ }
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.