Commit 7b0bdde5 authored by Ulrich Sibiller's avatar Ulrich Sibiller

update makekeys.c to libX11 1.3.4 (+ fix)

parent b4571a8f
...@@ -33,9 +33,6 @@ from The Open Group. ...@@ -33,9 +33,6 @@ from The Open Group.
#include <nx-X11/keysymdef.h> #include <nx-X11/keysymdef.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
char *malloc();
#endif /* macII */
typedef unsigned long Signature; typedef unsigned long Signature;
...@@ -46,14 +43,14 @@ static struct info { ...@@ -46,14 +43,14 @@ static struct info {
KeySym val; KeySym val;
} info[KTNUM]; } info[KTNUM];
#define MIN_REHASH 10 #define MIN_REHASH 15
#define MATCHES 10 #define MATCHES 10
char tab[KTNUM]; static char tab[KTNUM];
unsigned short offsets[KTNUM]; static unsigned short offsets[KTNUM];
unsigned short indexes[KTNUM]; static unsigned short indexes[KTNUM];
KeySym values[KTNUM]; static KeySym values[KTNUM];
char buf[1024]; static char buf[1024];
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
...@@ -100,12 +97,11 @@ main(int argc, char *argv[]) ...@@ -100,12 +97,11 @@ main(int argc, char *argv[])
key); key);
continue; continue;
} }
name = malloc((unsigned)strlen(key)+1); name = strdup(key);
if (!name) { if (!name) {
fprintf(stderr, "makekeys: out of memory!\n"); fprintf(stderr, "makekeys: out of memory!\n");
exit(1); exit(1);
} }
(void)strcpy(name, key);
info[ksnum].name = name; info[ksnum].name = name;
ksnum++; ksnum++;
if (ksnum == KTNUM) { if (ksnum == KTNUM) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment