"Fossies" - the Fresh Open Source Software Archive

Member "rbldnsd-0.998/dns_dnequ.c" (14 Mar 2013, 391 Bytes) of package /linux/misc/dns/rbldnsd-0.998.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "dns_dnequ.c" see the Fossies "Dox" file reference documentation.

    1 /* dns_dneq(): compare to domain names and return true if equal
    2  * (case-unsensitive)
    3  */
    4 
    5 #include "dns.h"
    6 
    7 int dns_dnequ(const unsigned char *dn1, const unsigned char *dn2) {
    8   unsigned c;
    9 
   10   for(;;) {
   11     if ((c = *dn1++) != *dn2++)
   12       return 0;
   13     if (!c)
   14       return 1;
   15     while(c--) {
   16       if (dns_dnlc(*dn1) != dns_dnlc(*dn2))
   17         return 0;
   18       ++dn1; ++dn2;
   19     }
   20   }
   21 }