summaryrefslogtreecommitdiffstats
path: root/avahi-core/domain-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-04-24 00:32:27 +0000
committerLennart Poettering <lennart@poettering.net>2006-04-24 00:32:27 +0000
commit5c22acadcbe5b01d910d75b71e86e06a425172d3 (patch)
tree43a481f81546d81b6b68cec2d809a75eca8e0e9c /avahi-core/domain-util.c
parentf458280b1aa97dbfcbf51cab006058b44c848654 (diff)
strip characters that are not in the set [a-zA-Z0-9-] from the local host name before using it in mDNS. (see #21)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1194 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/domain-util.c')
-rw-r--r--avahi-core/domain-util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/avahi-core/domain-util.c b/avahi-core/domain-util.c
index ab1ec8d..3aeba12 100644
--- a/avahi-core/domain-util.c
+++ b/avahi-core/domain-util.c
@@ -42,7 +42,10 @@ static void strip_bad_chars(char *s) {
s[strcspn(s, ".")] = 0;
for (p = s, d = s; *p; p++)
- if (isalnum(*p) || *p == '-')
+ if ((*p >= 'a' && *p <= 'z') ||
+ (*p >= 'A' && *p <= 'Z') ||
+ (*p >= '0' && *p <= '9') ||
+ *p == '-')
*(d++) = *p;
*d = 0;