summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xkbsrv.h2
-rw-r--r--xkb/XKBAlloc.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 5d5ea9b9b..b1df0d30c 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -299,8 +299,6 @@ extern _X_EXPORT char * XkbBinDirectory;
extern _X_EXPORT CARD32 xkbDebugFlags;
-#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
-
#define _XkbLibError(c,l,d) /* Epoch fail */
#define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))
#define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c))
diff --git a/xkb/XKBAlloc.c b/xkb/XKBAlloc.c
index 312f54ef9..6464e9970 100644
--- a/xkb/XKBAlloc.c
+++ b/xkb/XKBAlloc.c
@@ -36,6 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <xkbsrv.h>
#include "xkbgeom.h"
#include <os.h>
+#include <string.h>
/***===================================================================***/
@@ -64,8 +65,8 @@ XkbSymInterpretRec *prev_interpret;
return BadAlloc;
}
if (compat->num_si!=0) {
- _XkbClearElems(compat->sym_interpret,compat->num_si,
- compat->size_si-1,XkbSymInterpretRec);
+ memset(&compat->sym_interpret[compat->num_si], 0,
+ (compat->size_si - compat->num_si) * sizeof(XkbSymInterpretRec));
}
return Success;
}
@@ -159,8 +160,8 @@ XkbNamesPtr names;
names->key_aliases= xrealloc(names->key_aliases,
nTotalAliases * sizeof(XkbKeyAliasRec));
if (names->key_aliases!=NULL) {
- _XkbClearElems(names->key_aliases,names->num_key_aliases,
- nTotalAliases-1,XkbKeyAliasRec);
+ memset(&names->key_aliases[names->num_key_aliases], 0,
+ (nTotalAliases - names->num_key_aliases) * sizeof(XkbKeyAliasRec));
} else {
xfree(prev_aliases);
}
@@ -181,8 +182,8 @@ XkbNamesPtr names;
names->radio_groups= xrealloc(names->radio_groups,
nTotalRG * sizeof(Atom));
if (names->radio_groups!=NULL) {
- _XkbClearElems(names->radio_groups,names->num_rg,nTotalRG-1,
- Atom);
+ memset(&names->radio_groups[names->num_rg], 0,
+ (nTotalRG - names->num_rg) * sizeof(Atom));
} else {
xfree(prev_radio_groups);
}