Update xmodpap to version 1.0.11

pull/1/head
matthieu 2022-07-15 10:17:20 +00:00
parent 1d3ce46609
commit d14607210c
9 changed files with 207 additions and 57 deletions

View File

@ -1,3 +1,98 @@
commit 5579ae02a6b44f3072955f3e2f3249d2bd1201e4
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jul 10 15:49:43 2022 -0700
xmodmap 1.0.11
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 34df50af33d38621ce5d5a5510c7a4e70e1c17c1
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Apr 17 10:34:10 2022 -0700
PrintModifierMapping: stop leaking the map returned by XGetKeyboardMapping
Resolves issue reported by Oracle Parfait static analyzer:
Error: Memory leak
Memory leak [memory-leak] (CWE 401):
Memory leak of pointer pointer allocated with XGetKeyboardMapping(...)
at line 251 of app/xmodmap/exec.c in function 'PrintModifierMapping'.
pointer allocated at line 222 with XGetKeyboardMapping(...)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 10eecbe868b5c898ea9cd05d014fbf13c29c3a26
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Apr 17 10:19:58 2022 -0700
handle.c: avoid leaks when realloc() fails
Resolves issues reported by Oracle Parfait static analyzer:
Error: Memory leak
Memory leak [memory-leak] (CWE 401):
Memory leak of pointer kclist allocated with malloc((n * 1))
at line 698 of app/xmodmap/handle.c in function 'do_remove'.
kclist allocated at line 662 with malloc((n * 1))
kclist leaks when num_kcs != 0 at line 676
and (j + 1) >= num_kcs at line 687
and (nc + num_kcs) > tot at line 691
and (num_kcs - 1) < 0 at line 701.
Memory leak [memory-leak] (CWE 401):
Memory leak of pointer kclist allocated with malloc((n * 1))
at line 711 of app/xmodmap/handle.c in function 'do_remove'.
kclist allocated at line 662 with malloc((n * 1))
kclist leaks when (i + 1) >= n at line 672.
Error: Memory leak
Memory leak [memory-leak] (CWE 401):
Memory leak of pointer kclist allocated with realloc(kclist, (tot * 1))
at line 711 of app/xmodmap/handle.c in function 'do_remove'.
kclist allocated at line 693 with realloc(kclist, (tot * 1))
kclist leaks when (num_kcs - 1) < 0 at line 701
and (i + 1) >= n at line 672.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit d14cb47d9e9a10d04b1a7de9d2799fef9b0436e0
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Dec 7 12:36:29 2021 -0800
Build xz tarballs instead of bzip2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 90e2004549d79093ef7e1c17f99e64331c3e6661
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Dec 7 12:36:27 2021 -0800
gitlab CI: add a basic build test
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit fa9c38e6e7f1caa12d38f35c5633735bcaef3ba1
Author: Karl Fogel <kfogel@red-bean.com>
Date: Sat Mar 16 21:29:04 2019 -0500
Fix warning about number of mouse buttons
Change a warning to distinguish between too few buttons and too many.
Before this change:
$ xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
Warning: Only changing the first 15 of 10 buttons.
$
After this change:
$ xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
Warning: Not changing 5 extra buttons beyond 10.
$
Fixes: https://gitlab.freedesktop.org/xorg/app/xmodmap/issues/2
Signed-off-by: Karl Fogel <kfogel@red-bean.com>
commit c5a5fb06fd25c044f343f4571c645fd6c954d038
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Feb 19 15:33:29 2019 -0800
@ -193,7 +288,7 @@ Date: Fri Sep 6 15:56:02 2013 -0700
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit bf4620e2d78d2a4766948f136f2372a596ac275d
Author: Stéphane Aulery <lkppo@free.fr>
Author: Stéphane Aulery <lkppo@free.fr>
Date: Sun Jun 30 01:50:58 2013 +0200
error in manpage example about swapping Control_L/Caps_Lock keys
@ -762,7 +857,7 @@ Date: Fri Oct 14 00:25:47 2005 +0000
Use sed to fill in variables in man page
commit c4483b314106bcd2bb13e49650cfd279f74da73e
Author: Kristian Høgsberg <krh@redhat.com>
Author: Kristian Høgsberg <krh@redhat.com>
Date: Wed Sep 28 19:28:15 2005 +0000
Copy bits from COPYING here.
@ -790,7 +885,7 @@ Date: Thu Jul 28 02:58:59 2005 +0000
Add build system for xmodmap Add xmodmap to build script
commit 9145de293109ba96fc8b97ac59c16c51b992f416
Author: Kristian Høgsberg <krh@redhat.com>
Author: Kristian Høgsberg <krh@redhat.com>
Date: Thu Nov 11 15:37:01 2004 +0000
Fix #1818
@ -814,7 +909,7 @@ Date: Sat Oct 30 20:33:44 2004 +0000
4637857 - fix by Sam Lau)
commit ce64b2b312a73b9a4f266da8810ab552af4fbb1e
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri Oct 15 00:44:08 2004 +0000
Thu Oct 14 20:43:03 2004 Søren Sandmann <sandmann@redhat.com>

View File

@ -180,9 +180,9 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz
GZIP_ENV = --best
DIST_TARGETS = dist-bzip2 dist-gzip
DIST_TARGETS = dist-xz dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@ -302,6 +302,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -659,6 +660,7 @@ distdir: $(DISTFILES)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
@ -666,7 +668,6 @@ dist-bzip2: distdir
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)

View File

@ -19,9 +19,9 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
dnl serial 11 (pkg-config-0.29.1)
dnl
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
@ -62,7 +62,7 @@ dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.1])
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
@ -163,7 +163,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@ -173,11 +173,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@ -194,7 +194,7 @@ installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full

View File

@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
CYGWIN*)
CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

42
app/xmodmap/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for xmodmap 1.0.10.
# Generated by GNU Autoconf 2.69 for xmodmap 1.0.11.
#
# Report bugs to <https://gitlab.freedesktop.org/xorg/app/xmodmap/issues>.
#
@ -581,8 +581,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xmodmap'
PACKAGE_TARNAME='xmodmap'
PACKAGE_VERSION='1.0.10'
PACKAGE_STRING='xmodmap 1.0.10'
PACKAGE_VERSION='1.0.11'
PACKAGE_STRING='xmodmap 1.0.11'
PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/xmodmap/issues'
PACKAGE_URL=''
@ -733,6 +733,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -816,6 +817,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1068,6 +1070,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1205,7 +1216,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1318,7 +1329,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures xmodmap 1.0.10 to adapt to many kinds of systems.
\`configure' configures xmodmap 1.0.11 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1358,6 +1369,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -1388,7 +1400,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of xmodmap 1.0.10:";;
short | recursive ) echo "Configuration of xmodmap 1.0.11:";;
esac
cat <<\_ACEOF
@ -1505,7 +1517,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
xmodmap configure 1.0.10
xmodmap configure 1.0.11
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1920,7 +1932,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by xmodmap $as_me 1.0.10, which was
It was created by xmodmap $as_me 1.0.11, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -4061,7 +4073,7 @@ fi
# Define the identity of the package.
PACKAGE='xmodmap'
VERSION='1.0.10'
VERSION='1.0.11'
cat >>confdefs.h <<_ACEOF
@ -10649,8 +10661,8 @@ done
# Checks for pkg-config packages
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMODMAP" >&5
$as_echo_n "checking for XMODMAP... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x11 xproto >= 7.0.25" >&5
$as_echo_n "checking for x11 xproto >= 7.0.25... " >&6; }
if test -n "$XMODMAP_CFLAGS"; then
pkg_cv_XMODMAP_CFLAGS="$XMODMAP_CFLAGS"
@ -10690,7 +10702,7 @@ fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@ -10717,7 +10729,7 @@ Alternatively, you may set the environment variables XMODMAP_CFLAGS
and XMODMAP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@ -11381,7 +11393,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by xmodmap $as_me 1.0.10, which was
This file was extended by xmodmap $as_me 1.0.11, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -11447,7 +11459,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
xmodmap config.status 1.0.10
xmodmap config.status 1.0.11
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -24,7 +24,7 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xmodmap],
[1.0.10],
[1.0.11],
[https://gitlab.freedesktop.org/xorg/app/xmodmap/issues],
[xmodmap])
AC_CONFIG_SRCDIR([Makefile.am])
@ -33,7 +33,7 @@ AC_CONFIG_HEADERS([config.h])
AC_USE_SYSTEM_EXTENSIONS
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_INIT_AUTOMAKE([foreign dist-xz])
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],

View File

@ -208,6 +208,18 @@ ClearModifier(XModifierKeymap **mapp, int modifier)
return (0);
}
static int
GetKeysymsPerKeycode(void)
{
int min_keycode, max_keycode, keysyms_per_keycode = 0;
KeySym *m;
XDisplayKeycodes(dpy, &min_keycode, &max_keycode);
m = XGetKeyboardMapping(dpy, min_keycode, (max_keycode - min_keycode + 1),
&keysyms_per_keycode);
XFree(m);
return keysyms_per_keycode;
}
/*
* print the contents of the map
@ -215,21 +227,16 @@ ClearModifier(XModifierKeymap **mapp, int modifier)
void
PrintModifierMapping(XModifierKeymap *map, FILE *fp)
{
int i, k = 0;
int min_keycode, max_keycode, keysyms_per_keycode = 0;
XDisplayKeycodes (dpy, &min_keycode, &max_keycode);
XGetKeyboardMapping (dpy, min_keycode, (max_keycode - min_keycode + 1),
&keysyms_per_keycode);
int k = 0;
int keysyms_per_keycode = GetKeysymsPerKeycode();
fprintf (fp,
"%s: up to %d keys per modifier, (keycodes in parentheses):\n\n",
ProgramName, map->max_keypermod);
for (i = 0; i < 8; i++) {
int j;
for (int i = 0; i < 8; i++) {
fprintf(fp, "%-10s", modifier_table[i].name);
for (j = 0; j < map->max_keypermod; j++) {
for (int j = 0; j < map->max_keypermod; j++) {
if (map->modifiermap[k]) {
KeySym ks;
int index = 0;

View File

@ -37,6 +37,7 @@ from The Open Group.
#include "xmodmap.h"
#include "wq.h"
#include <stdlib.h>
#include <stdint.h>
#ifdef HAVE_STRNCASECMP
#include <strings.h>
@ -59,6 +60,26 @@ struct wq work_queue = {NULL, NULL};
* common utility routines
*/
/*
* This is a combination of reallocf() and reallocarray().
* If the realloc fails, it frees the old pointer so it doesn't leak.
*/
static void *
reallocfarray(void *old, size_t num, size_t size)
{
static void *new;
if (size > 0 && num > (SIZE_MAX / size)) /* overflow would happen */
new = NULL;
else
new = realloc(old, num * size);
if (new == NULL)
free(old);
return new;
}
static KeyCode *
KeysymToKeycodes(Display *dpy, KeySym keysym, int *pnum_kcs)
{
@ -72,7 +93,12 @@ KeysymToKeycodes(Display *dpy, KeySym keysym, int *pnum_kcs)
if (!kcs)
kcs = malloc(sizeof(KeyCode));
else
kcs = realloc(kcs, sizeof(KeyCode) * (*pnum_kcs + 1));
kcs = reallocfarray(kcs, (*pnum_kcs + 1), sizeof(KeyCode));
if (!kcs) {
fprintf(stderr, "attempt to allocate %ld byte keycode set",
(long) ((*pnum_kcs + 1) * sizeof (KeyCode)));
return NULL;
}
kcs[*pnum_kcs] = i;
*pnum_kcs += 1;
break;
@ -690,7 +716,7 @@ do_remove(char *line, int len)
}
if (nc + num_kcs > tot) {
tot = nc + num_kcs;
kclist = realloc(kclist, tot * sizeof(KeyCode));
kclist = reallocfarray(kclist, tot, sizeof(KeyCode));
if (!kclist) {
badmsg ("attempt to allocate %ld byte keycode list",
(long) (tot * sizeof (KeyCode)));
@ -708,6 +734,7 @@ do_remove(char *line, int len)
if (!uop) {
badmsg ("attempt to allocate %ld byte removemodifier opcode",
(long) sizeof (struct op_removemodifier));
free(kclist);
return;
}
oprm = &uop->removemodifier;
@ -889,8 +916,16 @@ do_pointer(char *line, int len)
}
if (i > 0 && i != nbuttons) {
fprintf (stderr, "Warning: Only changing the first %d of %d buttons.\n",
i, nbuttons);
if (i < nbuttons) {
fprintf (stderr,
"Warning: Only changing the first %d of %d buttons.\n",
i, nbuttons);
}
else { /* i > nbuttons */
fprintf (stderr,
"Warning: Not changing %d extra buttons beyond %d.\n",
i - nbuttons, nbuttons);
}
i = nbuttons;
}
@ -974,13 +1009,11 @@ get_keysym_list(const char *line, int len, int *np, KeySym **kslistp)
/* grow the list bigger if necessary */
if (havesofar >= maxcanhave) {
KeySym *origkeysymlist = keysymlist;
maxcanhave *= 2;
keysymlist = realloc (keysymlist, maxcanhave * sizeof (KeySym));
keysymlist = reallocfarray(keysymlist, maxcanhave, sizeof(KeySym));
if (!keysymlist) {
badmsg ("attempt to grow keysym list to %ld bytes",
(long) (maxcanhave * sizeof (KeySym)));
free(origkeysymlist);
return (-1);
}
}

View File

@ -247,6 +247,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@