From d5225315828a7592c1e91a39912f27f05d177062 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 6 Oct 2011 12:08:26 +0200 Subject: [PATCH] Remove useless memset for database creation --- src/database.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/database.c b/src/database.c index 2a871a4..fd88d0b 100644 --- a/src/database.c +++ b/src/database.c @@ -106,13 +106,11 @@ struct database *new_database(const char *id, NMEM nmem) struct setting *idset; db = nmem_malloc(nmem, sizeof(*db)); - memset(db, 0, sizeof(*db)); - db->url = nmem_strdup(nmem, id); - db->num_settings = PZ_MAX_EOF; db->settings = nmem_malloc(nmem, sizeof(struct settings*) * db->num_settings); + db->next = 0; memset(db->settings, 0, sizeof(struct settings*) * db->num_settings); idset = nmem_malloc(nmem, sizeof(*idset)); idset->precedence = 0; @@ -120,7 +118,6 @@ struct database *new_database(const char *id, NMEM nmem) idset->target = idset->value = db->url; idset->next = 0; db->settings[PZ_ID] = idset; - db->next = 0; return db; } -- 1.7.10.4