Add in header fields for per-object encryption/authentication.
[bluesky.git] / bluesky / util.c
index 0d24328..d292634 100644 (file)
@@ -78,11 +78,11 @@ BlueSkyRCStr *bluesky_string_new_from_gstring(GString *s)
 BlueSkyRCStr *bluesky_string_new_from_mmap(BlueSkyCacheFile *mmap,
                                            int offset, gsize len)
 {
-    g_assert(offset + len < mmap->len);
+    g_assert(offset + len <= mmap->len);
 
     BlueSkyRCStr *string = g_new(BlueSkyRCStr, 1);
     string->mmap = mmap;
-    g_atomic_int_inc(&mmap->refcount);
+    g_atomic_int_inc(&mmap->mapcount);
     string->data = (char *)mmap->addr + offset;
     string->len = len;
     g_atomic_int_set(&string->refcount, 1);