[glib] Don't write out zero-byte sections in builder



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]