summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2015-05-06 08:37:47 +0000
committergilles <gilles@openbsd.org>2015-05-06 08:37:47 +0000
commit1433fd94d3e65b578477f75677d84cd3d2c7fde2 (patch)
tree2ec36ade948b0a3a7286deabaee788dbc07299a3
parentAdd a format window_linked which is 1 if a window has been linked (diff)
downloadwireguard-openbsd-1433fd94d3e65b578477f75677d84cd3d2c7fde2.tar.xz
wireguard-openbsd-1433fd94d3e65b578477f75677d84cd3d2c7fde2.zip
use res_hnok() to valid domain part in valid_domain()
ok eric@
-rw-r--r--usr.sbin/smtpd/util.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/usr.sbin/smtpd/util.c b/usr.sbin/smtpd/util.c
index 419a6aa6ba6..56451c5cf74 100644
--- a/usr.sbin/smtpd/util.c
+++ b/usr.sbin/smtpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.112 2015/01/20 17:37:54 deraadt Exp $ */
+/* $OpenBSD: util.c,v 1.113 2015/05/06 08:37:47 gilles Exp $ */
/*
* Copyright (c) 2000,2001 Markus Friedl. All rights reserved.
@@ -493,24 +493,8 @@ valid_domainpart(const char *s)
return 0;
}
-
-nextsub:
- if (!isalnum((unsigned char)*s))
- return 0;
- while (*(++s) != '\0') {
- if (*s == '.')
- break;
- if (isalnum((unsigned char)*s) || *s == '-')
- continue;
- return 0;
- }
- if (s[-1] == '-')
- return 0;
- if (*s == '.') {
- s++;
- goto nextsub;
- }
- return 1;
+
+ return res_hnok(s);
}
/*