Make the sections array local to the keymap compiling function
authorRan Benita <ran234@gmail.com>
Fri, 2 Mar 2012 20:36:32 +0000 (22:36 +0200)
committerRan Benita <ran234@gmail.com>
Fri, 2 Mar 2012 23:17:57 +0000 (01:17 +0200)
Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/keymap.c

index 7906b2b..b610431 100644 (file)
@@ -39,8 +39,6 @@
 #define        SYMBOLS         4
 #define        MAX_SECTIONS    5
 
-static XkbFile *sections[MAX_SECTIONS];
-
 /**
  * Compile the given file and store the output in xkb.
  * @param file A list of XkbFiles, each denoting one type (e.g.
@@ -55,8 +53,9 @@ CompileKeymap(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
     unsigned mainType;
     char *mainName;
     LEDInfo *unbound = NULL;
+    XkbFile *sections[MAX_SECTIONS];
 
-    memset(sections, 0, MAX_SECTIONS * sizeof(XkbFile *));
+    memset(sections, 0, sizeof(sections));
     mainType = file->type;
     mainName = file->name;
     switch (mainType)