[PATCH XTS] lib/Xinput: include stdlib for getenv

Alan Coopersmith alan.coopersmith at oracle.com
Tue Jan 3 07:42:30 PST 2012


On 01/02/12 21:52, Peter Hutterer wrote:
> Crashes XSetDeviceFocus and probably everything else in XI that relies on
>     d = getenv("DISPLAY");
>     dpy = XOpenDisplay(d);
>
> With this patch, the tests now change from UNRESOLVED to UNTESTED. Hooray.
>
> Signed-off-by: Peter Hutterer<peter.hutterer at who-t.net>
> ---
> Figuring out why getenv() returns garbage took longer than necessary... I
> suspect there are a few more mines like this, but they're hard to spot given
> that there seem to be more warnings than regular compiler output.
>
>   xts5/src/lib/XInput.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/xts5/src/lib/XInput.c b/xts5/src/lib/XInput.c
> index eba66c5..067fca0 100644
> --- a/xts5/src/lib/XInput.c
> +++ b/xts5/src/lib/XInput.c
> @@ -68,6 +68,7 @@ SOFTWARE.
>   #endif
>
>   #include<stdio.h>
> +#include<stdlib.h>
>   #ifdef INPUTEXTENSION
>   #include "X11/extensions/XIproto.h"
>   #include "X11/extensions/XInput.h"

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
though the root cause seems to be people writing pointless code,
since XOpenDisplay(NULL) will do the getenv("DISPLAY") for you.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list