summaryrefslogtreecommitdiff
path: root/src/gnsrecord/gnsrecord_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnsrecord/gnsrecord_misc.c')
-rw-r--r--src/gnsrecord/gnsrecord_misc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c
index 3298168f4..54d8fb860 100644
--- a/src/gnsrecord/gnsrecord_misc.c
+++ b/src/gnsrecord/gnsrecord_misc.c
@@ -44,6 +44,22 @@ GNUNET_GNSRECORD_string_normalize (const char *src)
return GNUNET_STRINGS_utf8_normalize (src);
}
+enum GNUNET_GenericReturnValue
+GNUNET_GNSRECORD_label_check (const char*label, char **emsg)
+{
+ if (NULL == label)
+ {
+ *emsg = GNUNET_strdup (_ ("Label is NULL which is not allowed\n"));
+ return GNUNET_NO;
+ }
+ if (0 != strchr (label, '.'))
+ {
+ *emsg = GNUNET_strdup (_ ("Label contains `.' which is not allowed\n"));
+ return GNUNET_NO;
+ }
+ return GNUNET_OK;
+}
+
/**
* Convert a zone key to a string (for printing debug messages).
* This is one of the very few calls in the entire API that is