diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-12 08:32:04 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-12 08:32:04 +0200 |
commit | 051d521f6e20761ba6831cecd91883da960fa931 (patch) | |
tree | b28abba7818115d2fed80eb360a79a0f9183948e /nx-X11/lib/X11/cmsColNm.c | |
parent | 6dce607bad8711dd06a5a7b69ad1930386b4123b (diff) | |
parent | b8de7bf654929c823080b211aeac56cd213f5a32 (diff) | |
download | nx-libs-051d521f6e20761ba6831cecd91883da960fa931.tar.gz nx-libs-051d521f6e20761ba6831cecd91883da960fa931.tar.bz2 nx-libs-051d521f6e20761ba6831cecd91883da960fa931.zip |
Merge branch 'uli42-pr/upgrade_libX11' into 3.6.x
Attributes GH PR #214: https://github.com/ArcticaProject/nx-libs/pull/214
Fixes ArcticaProject/nx-libs#157.
Diffstat (limited to 'nx-X11/lib/X11/cmsColNm.c')
-rw-r--r-- | nx-X11/lib/X11/cmsColNm.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/nx-X11/lib/X11/cmsColNm.c b/nx-X11/lib/X11/cmsColNm.c index 1beaf2b88..82ffab5f6 100644 --- a/nx-X11/lib/X11/cmsColNm.c +++ b/nx-X11/lib/X11/cmsColNm.c @@ -2,7 +2,7 @@ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * All Rights Reserved - * + * * This file is a component of an X Window System-specific implementation * of Xcms based on the TekColor Color Management System. Permission is * hereby granted to use, copy, modify, sell, and otherwise distribute this @@ -10,10 +10,10 @@ * that this copyright, permission, and disclaimer notice is reproduced in * all copies of this software and in supporting documentation. TekColor * is a trademark of Tektronix, Inc. - * + * * Tektronix makes no representation about the suitability of this software * for any purpose. It is provided "as is" and with all faults. - * + * * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY @@ -184,7 +184,7 @@ _XcmsParseColorString( * DESCRIPTION * Assuming color_string contains a numerical string color * specification, attempts to parse a string into an - * XcmsColor structure. + * XcmsColor structure. * * RETURNS * 0 if failed; otherwise non-zero. @@ -467,7 +467,7 @@ Retry: pair->flag = CYCLE; return(XcmsFailure); } - + if (_XcmsParseColorString(ccc, pair->second, pColor) == XcmsSuccess) { /* f2 contains a numerical string specification */ return(XcmsSuccess); @@ -706,7 +706,7 @@ LoadColornameDB(void) { int size; FILE *stream; - char *pathname; + const char *pathname; struct stat txt; int length; @@ -732,10 +732,17 @@ LoadColornameDB(void) } if ((stream = _XFopenFile (pathname, "r")) == NULL) { + /* can't open file */ + XcmsColorDbState = XcmsDbInitFailure; return(XcmsFailure); } - stringSectionSize(stream, &nEntries, &size); + if (stringSectionSize(stream, &nEntries, &size) != XcmsSuccess || + nEntries == 0) { + (void) fclose(stream); + XcmsColorDbState = XcmsDbInitFailure; + return(XcmsFailure); + } rewind(stream); strings = (char *) Xmalloc(size); @@ -806,7 +813,7 @@ _XcmsCopyISOLatin1Lowered( /* * NAME - * _XcmsResolveColorString - + * _XcmsResolveColorString - * * SYNOPSIS */ @@ -862,7 +869,7 @@ _XcmsResolveColorString ( if (result_format != XcmsUndefinedFormat && pColor_exact_return->format != result_format) { /* need to be converted to the target format */ - return(XcmsConvertColors(ccc, pColor_exact_return, 1, + return(XcmsConvertColors(ccc, pColor_exact_return, 1, result_format, (Bool *)NULL)); } else { return(XcmsSuccess); |