diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-03-21 02:03:37 +0200 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2007-03-21 02:04:44 +0200 |
commit | f34b9a20b0181d3c2641c305e91180711afbd4b9 (patch) | |
tree | 7a41d05bed06b4f8c1e3791eded5a55da56cc4fb /xkb/xkbUtils.c | |
parent | 021fc5cb2cb4a7972b4a6fcb570c1da92787d68d (diff) |
XKB: Be a tiny bit more conservative with type allocation
Make sure size_types will _always_ be 0 if we don't have any types.
Diffstat (limited to 'xkb/xkbUtils.c')
-rw-r--r-- | xkb/xkbUtils.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 1d2366756..bb6d8a0ae 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -1140,6 +1140,9 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies) dtype->preserve = NULL; } } + + dst->map->size_types = src->map->num_types; + dst->map->num_types = src->map->num_types; } else { if (dst->map->types) { @@ -1155,9 +1158,9 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies) xfree(dst->map->types); dst->map->types = NULL; } + dst->map->num_types = 0; + dst->map->size_types = 0; } - dst->map->size_types = src->map->num_types; - dst->map->num_types = src->map->num_types; if (src->map->modmap) { if (src->max_key_code != dst->max_key_code) { |