]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/writer.c
Format off_t data types properly for printing
[people/ms/libloc.git] / src / writer.c
index 594df1a0327672ce072e8099a213aa7a70a57d85..c241e8b49584bf0cb82f7534e78a12255cc5f5e3 100644 (file)
@@ -235,7 +235,7 @@ static void align_page_boundary(off_t* offset, FILE* f) {
 static int loc_database_write_pool(struct loc_writer* writer,
                struct loc_database_header_v0* header, off_t* offset, FILE* f) {
        // Save the offset of the pool section
-       DEBUG(writer->ctx, "Pool starts at %jd bytes\n", *offset);
+       DEBUG(writer->ctx, "Pool starts at %jd bytes\n", (intmax_t)*offset);
        header->pool_offset = htobe32(*offset);
 
        // Write the pool
@@ -250,7 +250,7 @@ static int loc_database_write_pool(struct loc_writer* writer,
 
 static int loc_database_write_as_section(struct loc_writer* writer,
                struct loc_database_header_v0* header, off_t* offset, FILE* f) {
-       DEBUG(writer->ctx, "AS section starts at %jd bytes\n", *offset);
+       DEBUG(writer->ctx, "AS section starts at %jd bytes\n", (intmax_t)*offset);
        header->as_offset = htobe32(*offset);
 
        size_t as_length = 0;
@@ -325,7 +325,7 @@ static void free_network(struct network* network) {
 static int loc_database_write_networks(struct loc_writer* writer,
                struct loc_database_header_v0* header, off_t* offset, FILE* f) {
        // Write the network tree
-       DEBUG(writer->ctx, "Network tree starts at %jd bytes\n", *offset);
+       DEBUG(writer->ctx, "Network tree starts at %jd bytes\n", (intmax_t)*offset);
        header->network_tree_offset = htobe32(*offset);
 
        size_t network_tree_length = 0;
@@ -415,7 +415,7 @@ static int loc_database_write_networks(struct loc_writer* writer,
 
        align_page_boundary(offset, f);
 
-       DEBUG(writer->ctx, "Networks data section starts at %jd bytes\n", *offset);
+       DEBUG(writer->ctx, "Networks data section starts at %jd bytes\n", (intmax_t)*offset);
        header->network_data_offset = htobe32(*offset);
 
        // We have now written the entire tree and have all networks