summaryrefslogtreecommitdiff
path: root/src/Attrib.c
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-02-11 10:53:05 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-02-11 10:53:05 +0000
commitdf39054c869d26b1aeeaca958b54869521802712 (patch)
treef9ace3a7fc35498f101ec41da1d83edf47ccbd06 /src/Attrib.c
parentc3ba808aef8fcf59b04eb959e9958159648eae8a (diff)
downloadxorg-lib-libXpm-df39054c869d26b1aeeaca958b54869521802712.tar.gz
Import changes from XORG-6.8.2CYGWIN-6_8_2-MERGECYGWIN
Diffstat (limited to 'src/Attrib.c')
-rw-r--r--src/Attrib.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Attrib.c b/src/Attrib.c
index cf7081c..028c2cb 100644
--- a/src/Attrib.c
+++ b/src/Attrib.c
@@ -32,13 +32,15 @@
* Developed by Arnaud Le Hors *
\*****************************************************************************/
+/* October 2004, source code review by Thomas Biege <thomas@suse.de> */
+
#include "XpmI.h"
/* 3.2 backward compatibility code */
LFUNC(CreateOldColorTable, int, (XpmColor *ct, unsigned int ncolors,
XpmColor ***oldct));
-LFUNC(FreeOldColorTable, void, (XpmColor **colorTable, int ncolors));
+LFUNC(FreeOldColorTable, void, (XpmColor **colorTable, unsigned int ncolors));
/*
* Create a colortable compatible with the old style colortable
@@ -50,9 +52,9 @@ CreateOldColorTable(ct, ncolors, oldct)
XpmColor ***oldct;
{
XpmColor **colorTable, **color;
- int a;
+ unsigned int a;
- if (ncolors >= SIZE_MAX / sizeof(XpmColor *))
+ if (ncolors >= UINT_MAX / sizeof(XpmColor *))
return XpmNoMemory;
colorTable = (XpmColor **) XpmMalloc(ncolors * sizeof(XpmColor *));
@@ -69,9 +71,9 @@ CreateOldColorTable(ct, ncolors, oldct)
static void
FreeOldColorTable(colorTable, ncolors)
XpmColor **colorTable;
- int ncolors;
+ unsigned int ncolors;
{
- int a, b;
+ unsigned int a, b;
XpmColor **color;
char **sptr;
@@ -122,7 +124,7 @@ XpmFreeExtensions(extensions, nextensions)
XpmExtension *ext;
char **sptr;
- if (extensions) {
+ if (extensions && nextensions > 0) {
for (i = 0, ext = extensions; i < nextensions; i++, ext++) {
if (ext->name)
XpmFree(ext->name);