From 96d5eb47bcc4ad5cd938f8f2229d2c93caf7db44 Mon Sep 17 00:00:00 2001 From: Federico Lucifredi Date: Thu, 27 Dec 2007 06:33:38 +0000 Subject: fixes. git-svn-id: file:///home/lennart/svn/public/avahi/branches/federico@1648 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/domain-util.c | 7 +++++-- avahi-core/domain-util.h | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/avahi-core/domain-util.c b/avahi-core/domain-util.c index 7d03afa..c98963c 100644 --- a/avahi-core/domain-util.c +++ b/avahi-core/domain-util.c @@ -195,10 +195,13 @@ char * c_to_canonical_string(char* input) while(avahi_unescape_label(&input, label, AVAHI_LABEL_MAX)) { - result++ = strlen(label); + *result = (char)strlen(label); + result++; do { - result++ = label++; + *result = *label; + result++; + label++; } while(*label) printf("intermediate result: -%s-\n", result);*/ diff --git a/avahi-core/domain-util.h b/avahi-core/domain-util.h index 01233d8..6e51854 100644 --- a/avahi-core/domain-util.h +++ b/avahi-core/domain-util.h @@ -42,6 +42,9 @@ int avahi_binary_domain_cmp(const char *a, const char *b); /** Returns 1 if the the end labels of domain are eqal to suffix */ int avahi_domain_ends_with(const char *domain, const char *suffix); +/** returns canonical DNS representation of C string representing a domain */ +char * c_to_canonical_string(char* input) + AVAHI_C_DECL_END #endif -- cgit