summaryrefslogtreecommitdiffstats
path: root/ucad.c
diff options
context:
space:
mode:
Diffstat (limited to 'ucad.c')
-rw-r--r--ucad.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ucad.c b/ucad.c
index 6e401b1..ec0f7d2 100644
--- a/ucad.c
+++ b/ucad.c
@@ -135,6 +135,10 @@ serialize_param_spec (GParamSpec *pspec, UcaNetMessageProperty *prop)
for (guint i = 0; i < MIN (enum_class->n_values, UCA_NET_MAX_ENUM_LENGTH); i++) {
prop->spec.genum.values[i] = enum_class->values[i].value;
+
+ if (strlen (enum_class->values[i].value_name) > UCA_NET_MAX_ENUM_NAME_LENGTH)
+ g_warning ("Enum value name too long, expect serious problems");
+
strncpy (prop->spec.genum.value_names[i], enum_class->values[i].value_name,
UCA_NET_MAX_ENUM_NAME_LENGTH);
}