aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-create.c
diff options
context:
space:
mode:
Diffstat (limited to 'libctf/ctf-create.c')
-rw-r--r--libctf/ctf-create.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c
index 651d39d..50f48eb 100644
--- a/libctf/ctf-create.c
+++ b/libctf/ctf-create.c
@@ -2403,6 +2403,12 @@ membadd (const char *name, ctf_id_t type, unsigned long offset, void *arg)
if ((dmd = malloc (sizeof (ctf_dmdef_t))) == NULL)
return (ctf_set_errno (ctb->ctb_dict, EAGAIN));
+ /* Unnamed members in non-dynamic dicts have a name of "", while dynamic dicts
+ use NULL. Adapt. */
+
+ if (name[0] == 0)
+ name = NULL;
+
if (name != NULL && (s = strdup (name)) == NULL)
{
free (dmd);