From ec3ca82d595f0c7f18a109e87289b036c5264f68 Mon Sep 17 00:00:00 2001 From: wim Date: Wed, 16 Jun 2004 14:48:05 +0000 Subject: [PATCH] (map_add): Fix off by one bug that causes random crashes in gdomap. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19535 72102866-910b-0410-8b05-ffd578937521 --- Tools/gdomap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/gdomap.c b/Tools/gdomap.c index 329fc869d..b458fffad 100644 --- a/Tools/gdomap.c +++ b/Tools/gdomap.c @@ -655,7 +655,7 @@ map_add(uptr n, unsigned char l, unsigned int p, unsigned char t) m->svc = (t & GDO_SVC_MASK); memcpy(m->name, n, l); - if (map_used + 1 >= map_size) + if (map_used >= map_size) { if (map_size) { @@ -674,7 +674,7 @@ map_add(uptr n, unsigned char l, unsigned int p, unsigned char t) { int j; - for (j = map_used+1; j > i; j--) + for (j = map_used; j > i; j--) { map[j] = map[j-1]; }