summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-09-15 16:34:16 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-09-15 16:34:16 +0000
commit6df140632e5c28c496208895337464d58825fddd (patch)
treed82dfb3c788b15c30629650f9857e7e0301ac4d7
parentb1c614eed0ab713d9cc3626f30f268f316101d67 (diff)
-rw-r--r--di/options.c2
-rw-r--r--di/resource.c11
-rw-r--r--os/connection.c11
3 files changed, 16 insertions, 8 deletions
diff --git a/di/options.c b/di/options.c
index 0ba4bb6..49b10ab 100644
--- a/di/options.c
+++ b/di/options.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/lbxproxy/di/options.c,v 1.1.4.3.4.1 2004/03/04 17:48:50 eich Exp $ */
+/* $XdotOrg: xc/programs/lbxproxy/di/options.c,v 1.2 2004/04/23 19:54:33 eich Exp $ */
/* $Xorg: options.c,v 1.4 2001/02/09 02:05:31 xorgcvs Exp $ */
/*
diff --git a/di/resource.c b/di/resource.c
index 2b7811e..b0f0d43 100644
--- a/di/resource.c
+++ b/di/resource.c
@@ -1,4 +1,5 @@
/* $Xorg: resource.c,v 1.4 2000/08/17 19:53:56 cpqbld Exp $ */
+/* $XdotOrg: xc/programs/lbxproxy/di/resource.c,v 1.2 2004/04/23 19:54:33 eich Exp $ */
/*
Copyright 1987, 1998 The Open Group
@@ -471,10 +472,12 @@ LookupIDByType(pclient, id, rtype)
if (pserver->clientTable[i].buckets) {
for (j = 0; j < INITBUCKETS; j++) {
if (pserver->clientTable[i].resources[j]) {
- res = pserver->clientTable[i].resources[Hash(j, id)];
- for (; res; res = res->next)
- if ((res->id == id) && (res->type == rtype))
- return res->value;
+ if (clients[j]) {
+ res = pserver->clientTable[i].resources[Hash(j, id)];
+ for (; res; res = res->next)
+ if ((res->id == id) && (res->type == rtype))
+ return res->value;
+ }
}
}
}
diff --git a/os/connection.c b/os/connection.c
index 721cd40..47bee88 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1,4 +1,5 @@
/* $Xorg: connection.c,v 1.5 2001/02/09 02:05:33 xorgcvs Exp $ */
+/* $Xdotorg$ */
/***********************************************************
Copyright 1987, 1989, 1998 The Open Group
@@ -168,12 +169,16 @@ PickNewListenDisplay (displayP)
char **displayP;
{
static char newDisplay[16];
- sprintf (newDisplay, "%d", atoi (*displayP) + 1);
- *displayP = newDisplay;
+ long displayNum;
- if (atoi (*displayP) > 65535)
+ errno = 0;
+ displayNum = strtol (*displayP, NULL, 10);
+ if ((displayNum >= 65535) || (displayNum < 0) || (errno != 0))
return (FALSE);
+ sprintf (newDisplay, "%d", displayNum + 1);
+ *displayP = newDisplay;
+
return (TRUE);
}