1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-26 21:10:38 +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 = { struct part part = {
.domain = domain, .domain = domain,
.name = name, .name = name,
.param = NULL,
.stock = NULL,
}; };
struct part *p; struct part *p;
@ -63,7 +65,7 @@ struct part *part_add(const char *domain, const char *name)
p = g_tree_lookup(tree, &part); p = g_tree_lookup(tree, &part);
if (!p) { if (!p) {
p = alloc_type(struct part); p = alloc_type(struct part);
p->stock = NULL; *p = part;
p->next = p->prev = p; p->next = p->prev = p;
g_tree_insert(tree, p, p); g_tree_insert(tree, p, p);
} }