]> Pileus Git - ~andy/fetchmail/blobdiff - checkalias.c
Cosmetic cleanup.
[~andy/fetchmail] / checkalias.c
index 7b377eb22b645734a4da1326d33cff5abab001f4..28d7861f59456191c7b3fd24303a33fcc3208555 100644 (file)
@@ -131,15 +131,15 @@ int is_host_alias(const char *name, struct query *ctl)
        char    *ep;
 
        /*
-        * Test is <= here because str_in_list() should have caught the
+        * Test is >= here because str_in_list() should have caught the
         * equal-length case above.  Doing it this way guarantees that
         * ep[-1] is a valid reference.
         */
-       if (strlen(idl->id) <= namelen)
-           break;
-       ep = idl->id + (strlen(idl->id) - namelen);
+       if (strlen(idl->id) >= namelen)
+           continue;
+       ep = (char *)name + (namelen - strlen(idl->id));
        /* a suffix led by . must match */
-       if (ep[-1] == '.' && !strcmp(ep, name))
+       if (ep[-1] == '.' && !strcmp(ep, idl->id))
            return(TRUE);
     }