mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-04 23:41:55 +02:00
b2/db.c (part_add): fix jumbled initialization mess
This commit is contained in:
parent
c92ba6f21a
commit
e7b2e65795
4
b2/db.c
4
b2/db.c
@ -55,6 +55,8 @@ struct part *part_add(const char *domain, const char *name)
|
||||
struct part part = {
|
||||
.domain = domain,
|
||||
.name = name,
|
||||
.param = NULL,
|
||||
.stock = NULL,
|
||||
};
|
||||
struct part *p;
|
||||
|
||||
@ -63,7 +65,7 @@ struct part *part_add(const char *domain, const char *name)
|
||||
p = g_tree_lookup(tree, &part);
|
||||
if (!p) {
|
||||
p = alloc_type(struct part);
|
||||
p->stock = NULL;
|
||||
*p = part;
|
||||
p->next = p->prev = p;
|
||||
g_tree_insert(tree, p, p);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user