if (cpp != 0 && width >= (SIZE_MAX - 3)/cpp) return XpmNoMemory;
WritePixels(file, width, height, cpp, pixels, colors)    FILE *file;    unsigned int width;    unsigned int height;    unsigned int cpp;    unsigned int *pixels;    XpmColor *colors;{    char *s, *p, *buf;    unsigned int x, y, h;    h = height - 1;    p = buf = (char *) XpmMalloc(width * cpp + 3);    if (!buf)	return (XpmNoMemory);    *buf = '"';    p++;    for (y = 0; y < h; y++) {	s = p;	for (x = 0; x < width; x++, pixels++) {	    strncpy(s, colors[*pixels].string, cpp);	    s += cpp;	}	*s++ = '"';	*s = '\0';	fprintf(file, "%s,\n", buf);    }    /* duplicate some code to avoid a test in the loop */    s = p;    for (x = 0; x < width; x++, pixels++) {	strncpy(s, colors[*pixels].string, cpp);	s += cpp;    }    *s++ = '"';    *s = '\0';    fprintf(file, "%s", buf);    XpmFree(buf);    return (XpmSuccess);}