File: dns_dnlen.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 (13 lines) | stat: -rw-r--r-- 292 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* dns_dnlen(): return length of a domain name (with trailing
 * zero, as it is an integral part of DN)
 */

#include "dns.h"

unsigned dns_dnlen(register const unsigned char *dn) {
  register unsigned c;
  const unsigned char *d = dn;
  while((c = *d++) != 0)
    d += c;
  return d - dn;
}