diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h index 8767117..89877ac 100644 --- a/include/bsd/nlist.h +++ b/include/bsd/nlist.h @@ -36,9 +36,12 @@ struct nlist { union { char *n_name; - struct n_list *n_next; - long n_strx; - } n_un; + union { + char *n_name; + struct n_list *n_next; + long n_strx; + } n_un; + }; unsigned char n_type; char n_other; short n_desc; diff --git a/test/nlist.c b/test/nlist.c index c76d9e7..82e24e9 100644 --- a/test/nlist.c +++ b/test/nlist.c @@ -66,6 +66,8 @@ main(int argc, char **argv) assert(*data_pub_ptr == 50); + assert(nl[0].n_name == nl[0].n_un.n_name); + rc = nlist(argv[0], nl); assert(rc == 0);