[Tux3] [PATCH] Fix bug inserting an entry in the beginning of a group

Shapor Naghibzadeh shapor at gmail.com
Thu Aug 7 23:38:50 PDT 2008


# HG changeset patch
# User shapor at yzf.shapor.com
# Date 1218177509 25200
# Node ID f7889cc1c980f619b9b98aa919300755a08ab083
# Parent  7ebc24c26abc5fb711a2942a45abe02c297a3e95
Fix bug inserting an entry in the beginning of a group.

diff -r 7ebc24c26abc -r f7889cc1c980 user/test/fleaf.c
--- a/user/test/fleaf.c	Thu Aug 07 11:32:40 2008 -0700
+++ b/user/test/fleaf.c	Thu Aug 07 23:38:29 2008 -0700
@@ -273,7 +273,7 @@ target = target & 0xffffffffffffLL;
 	if (entry == enbase || loglo < entry->loglo) {
 		printf("insert 0x%Lx at %u in group %u\n", target, entries - entry, groups - group);
 		memmove(used - sizeof(*entry), used, (void *)(entry + 1) - used);
-		*entry = (struct entry){ .loglo = loglo, .limit = !group->count ? 0 : (entry + 1)->limit };
+		*entry = (struct entry){ .loglo = loglo, .limit = !group->count || entry == entries ? 0 : (entry + 1)->limit };
 		used -= sizeof(*entry);
 		enbase--;
 		group->count++;

_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list