--- src/xcms/cmsColNm.c.org 2008-03-31 18:53:39.000000000 +0200 +++ src/xcms/cmsColNm.c 2008-03-31 18:53:46.000000000 +0200 @@ -711,7 +711,7 @@ FILE *stream; const char *pathname; struct stat txt; - int length; + int length,ret; /* use and name of this env var is not part of the standard */ /* implementation-dependent feature */ @@ -733,12 +733,19 @@ XcmsColorDbState = XcmsDbInitFailure; return(XcmsFailure); } + stream = _XFopenFile (pathname, "r"); + if (stream == NULL) { + return(XcmsFailure); + } - if ((stream = _XFopenFile (pathname, "r")) == NULL) { + ret=stringSectionSize(stream, &nEntries, &size); + + if (ret != XcmsSuccess || nEntries == 0 ) { + (void) fclose(stream); + XcmsColorDbState = XcmsDbInitFailure; return(XcmsFailure); } - stringSectionSize(stream, &nEntries, &size); rewind(stream); strings = (char *) Xmalloc(size);