Do not return the address of a local buffer

Make the const buffer returned by FindDevice a static const buffer, to avoid
letting be on the stack.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
Samuel Thibault
2010-07-28 21:23:25 +02:00
parent 75300d6ae5
commit b9d6d0309a

View File

@@ -171,7 +171,7 @@ OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
static const char *
FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
{
const char path[] = DEFAULT_MOUSE_DEV;
static const char path[] = DEFAULT_MOUSE_DEV;
int fd;
SYSCALL (fd = open(path, O_RDWR | O_NONBLOCK | O_EXCL));