summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2012-01-06 17:18:55 +0100
committerLars Knoll <lars.knoll@nokia.com>2012-01-06 23:06:22 +0100
commit7ef5aa21ace014cccc94420ba7624f2f0477bf1c (patch)
treef5042d956513fcafa110687cb37c5310c3a87452 /src
parentb80bc3f04d650cf8a38429dfb5473daf38a0a4b8 (diff)
Fixed broken binary output after compaction
The tag was not present in the header after compaction was triggered Change-Id: I329519698961e615a378b51711fbb4d7978af665 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qjson.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qjson.cpp b/src/qjson.cpp
index 6d1aa70..fb31187 100644
--- a/src/qjson.cpp
+++ b/src/qjson.cpp
@@ -65,6 +65,8 @@ void Data::compact()
int size = sizeof(Base) + reserve + base->length*sizeof(offset);
int alloc = sizeof(Header) + size;
Header *h = (Header *) malloc(alloc);
+ h->tag = QBJS_Tag;
+ h->version = 1;
Base *b = h->root();
b->size = size;
b->is_object = header->root()->is_object;