[glib: 3/5] Don't write out zero-byte sections in builder
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 3/5] Don't write out zero-byte sections in builder
- Date: Wed, 21 Apr 2010 00:14:14 +0000 (UTC)
commit 2d9811ebdaee294ac9a1826db5be891b2b90d67f
Author: Ryan Lortie <desrt desrt ca>
Date: Mon Apr 19 10:28:44 2010 -0400
Don't write out zero-byte sections in builder
This and the previous issue caught by Christian Persch in bug #616156
gvdb-builder.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gvdb-builder.c b/gvdb-builder.c
index de9fff2..7cca13f 100644
--- a/gvdb-builder.c
+++ b/gvdb-builder.c
@@ -236,6 +236,9 @@ file_builder_allocate (FileBuilder *fb,
{
FileChunk *chunk;
+ if (size == 0)
+ return NULL;
+
fb->offset += (-fb->offset) & (alignment - 1);
chunk = g_slice_new (FileChunk);
chunk->offset = fb->offset;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]