[glib] Don't write out zero-byte sections in builder
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Don't write out zero-byte sections in builder
- Date: Mon, 19 Apr 2010 14:40:15 +0000 (UTC)
commit 40fdc929f86243a936609a4008e9fb013c9f4f7d
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
gio/gvdb/gvdb-builder.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gio/gvdb/gvdb-builder.c b/gio/gvdb/gvdb-builder.c
index de9fff2..7cca13f 100644
--- a/gio/gvdb/gvdb-builder.c
+++ b/gio/gvdb/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]