File: dns_dntol.c

package info (click to toggle)
rbldnsd 0.998b~pre1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 744 kB
  • ctags: 1,132
  • sloc: ansic: 8,212; python: 549; sh: 502; makefile: 249; awk: 33
file content (16 lines) | stat: -rw-r--r-- 329 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* dns_dntol() lowercases a domain name
 */

#include "dns.h"

unsigned dns_dntol(const unsigned char *srcdn, unsigned char *dstdn) {
  unsigned c;
  const unsigned char *s = srcdn;
  while((c = (*dstdn++ = *s++)) != 0) {
    do {
      *dstdn++ = dns_dnlc(*s);
      ++s;
    } while(--c);
  }
  return (unsigned)(s - srcdn);
}