1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 09:15:31 +02:00

b2/db.c (part_add): fix jumbled initialization mess

This commit is contained in:
Werner Almesberger 2012-04-28 22:55:34 -03:00
parent c92ba6f21a
commit e7b2e65795

View File

@ -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);
}