Commit graph

13 commits

Author SHA1 Message Date
Keith Packard
622de26180 Avoid memory leak in XKeysymToString
Instead of calling malloc each time this function is invoked, use
the Quark database to ensure the return value lasts forever while not
leaking memory.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Harris <pharris2@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/282>
2025-08-09 20:01:49 +00:00
Thomas E. Dickey
844271305a
reduce gcc-normal warnings using casts (no object change)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-04-21 20:56:05 -04:00
Alan Coopersmith
b687440c28 Convert more sprintf calls to snprintf
You could analyze most of these and quickly recognize that there was no
chance of buffer overflow already, but why make everyone spend time doing
that when we can just make it obviously safe?

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-16 10:42:23 -08:00
Alan Coopersmith
b092dabbd7 XKeysymToString: move variable declarations to the scope of their usage
Makes it easier for readers to understand scope of variable usage, and
clears up gcc warning:

KeysymStr.c: In function 'XKeysymToString':
KeysymStr.c:128:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
KeysymStr.c:73:18: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-16 10:20:53 -08:00
Derek Buitenhuis
24283d40b1 makekeys: Fix build/target word size mismatch when cross-compiling
Since makekeys is built using build environment's gcc and
runs natively, we have to make sure that the size of the
Signature type is the same on both the native environment
and the target, otherwise we get mismatches upon running X,
and some LSB test failures (xts5).

Use an unsigned 32-bit integer on all platforms. Also,
eliminate the redundant multiple typedefs for the
Signature type.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-11-11 00:36:57 +00:00
Alan Coopersmith
ddb1786720 Purge CVS/RCS id tags
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-14 17:38:26 -08:00
Alan Coopersmith
cf49e53701 Strip whitespace from end of lines in source files 2008-06-17 14:41:17 -07:00
Magnus Kessler
a48386ce6b Switched function definitions from K&R to ANSI style. 2007-05-01 15:20:08 +02:00
Søren Sandmann Pedersen
7eee605e3a - For now put xtrans in X11/Xtrans/X11, since libX11 is looking for it in <X11/...>
- For Xcomposite and Xdamage, don't link the build system out of the xc tree
- Link the public X11 headers into their own directory
- Add links to XKeysymDB and XErrorDB
- Add links to all the Xlib man pages
- Add links to the lcUniConv subdirectory
- Conditionally include config.h in Xlib source
2005-05-13 22:53:36 +00:00
Markus Kuhn
d1f76d17ec bug fix for previous patch 2004-09-26 22:54:57 +00:00
Markus Kuhn
48932d9b71 The big keysym cleanup, to bring implementation in line with the recent revision of Appendix A of the protocol spec. (Markus Kuhn) 2004-09-26 20:46:17 +00:00
Egbert Eich
c6349f4319 Merging XORG-CURRENT into trunk 2004-04-23 18:42:09 +00:00
Kaleb Keithley
deae12c6b6 R6.6 is the Xorg base-line 2003-11-14 15:54:30 +00:00