summaryrefslogtreecommitdiff
path: root/RaA8.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2010-04-29 20:19:38 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2010-05-05 15:46:28 -0700
commit30e388a8284ed100893983178acb6b4e3ff2b815 (patch)
tree68ea9a13627712ca9dea9b1e856df66cdbef10c6 /RaA8.c
parent110078a137915f486a13e0445ee9ba5e1558c081 (diff)
Deal with lint warnings about implicit narrowing conversions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'RaA8.c')
-rw-r--r--RaA8.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/RaA8.c b/RaA8.c
index 3e7bc08..ac85ae7 100644
--- a/RaA8.c
+++ b/RaA8.c
@@ -36,16 +36,21 @@ in this Software without prior written authorization from The Open Group.
#include <X11/X.h>
#include <X11/Xmd.h>
#include <X11/Xdmcp.h>
+#include <limits.h>
int
XdmcpReallocARRAY8 (ARRAY8Ptr array, int length)
{
CARD8Ptr newData;
+ /* length defined in ARRAY8 struct is a CARD16 (not CARD8 like the rest) */
+ if (length > UINT16_MAX)
+ return FALSE;
+
newData = (CARD8Ptr) Xrealloc (array->data, length * sizeof (CARD8));
if (!newData)
return FALSE;
- array->length = length;
+ array->length = (CARD16) length;
array->data = newData;
return TRUE;
}