writer: Correctly increase offset when writing ASes
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Dec 2017 14:41:35 +0000 (14:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Dec 2017 14:41:35 +0000 (14:41 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/writer.c

index 8c6ed88..6427d47 100644 (file)
@@ -211,7 +211,7 @@ static int loc_database_write_as_section(struct loc_writer* writer,
                loc_as_to_database_v0(writer->as[i], &as);
 
                // Write to disk
-               offset += fwrite(&as, 1, sizeof(as), f);
+               *offset += fwrite(&as, 1, sizeof(as), f);
                as_length += sizeof(as);
        }