summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--avahi-core/domain-util.c7
-rw-r--r--avahi-core/domain-util.h3
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