dict BUGFIX allow storing "" strings
Allow storing 0 length strings in dictionary, since they are valid
values for some cases.
diff --git a/src/dict.c b/src/dict.c
index f9751cd..e4887e4 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -209,7 +209,7 @@
len = strlen(value);
}
- if (!value || !len) {
+ if (!value) {
return NULL;
}
return dict_insert(ctx, (char *)value, len, 0);
@@ -218,10 +218,8 @@
const char *
lydict_insert_zc(struct ly_ctx *ctx, char *value)
{
- int len;
-
- if (!value || !(len = strlen(value))) {
+ if (!value) {
return NULL;
}
- return dict_insert(ctx, value, len, 1);
+ return dict_insert(ctx, value, strlen(value), 1);
}