]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/database.c
stringpool: Make them initializable right from the file
[people/ms/libloc.git] / src / database.c
index 41b5ffd3c9687bd635915f4521f82035211b1165..3a4f8b8bb13a81dd4099bdb78b3b89edd6b9b173 100644 (file)
@@ -120,11 +120,8 @@ static int loc_database_read_header_v0(struct loc_database* db) {
        off_t pool_offset  = ntohl(header.pool_offset);
        size_t pool_length = ntohl(header.pool_length);
 
-       int r = loc_stringpool_new(db->ctx, &db->pool, 0);
-       if (r)
-               return r;
-
-       r = loc_stringpool_read(db->pool, db->file, pool_offset, pool_length);
+       int r = loc_stringpool_open(db->ctx, &db->pool,
+               db->file, pool_length, pool_offset);
        if (r)
                return r;