use calloc instead of memset and get rid of a duplicated field

This commit is contained in:
Christopher Chedeau
2014-04-18 16:03:29 -07:00
parent 75ab7b6f39
commit 02d8f35b9a
2 changed files with 1 additions and 3 deletions

View File

@@ -10,7 +10,6 @@
#define CSS_UNDEFINED NAN
void init_css_node(css_node_t *node) {
memset(node, 0, sizeof(*node));
node->style.align_items = CSS_ALIGN_FLEX_START;
// Some of the fields default to undefined and not 0
@@ -27,7 +26,7 @@ void init_css_node(css_node_t *node) {
}
css_node_t *new_css_node() {
css_node_t *node = malloc(sizeof(*node));
css_node_t *node = calloc(1, sizeof(*node));
init_css_node(node);
return node;
}