strncpy(s, colors[*pixels].string, cpp);
if(cpp >= (data_size - (s-dataptr))) return; strncpy(s, colors[*pixels].string, cpp);
WritePixels(dataptr, used_size, width, height, cpp, pixels, colors)    char *dataptr;    unsigned int *used_size;    unsigned int width;    unsigned int height;    unsigned int cpp;    unsigned int *pixels;    XpmColor *colors;{    char *s = dataptr;    unsigned int x, y, h;    h = height - 1;    for (y = 0; y < h; y++) {	*s++ = '"';	for (x = 0; x < width; x++, pixels++) {	    strncpy(s, colors[*pixels].string, cpp);	    s += cpp;	}	strcpy(s, "\",\n");	s += 3;    }    /* duplicate some code to avoid a test in the loop */    *s++ = '"';    for (x = 0; x < width; x++, pixels++) {	strncpy(s, colors[*pixels].string, cpp);	s += cpp;    }    *s++ = '"';    *used_size += s - dataptr;}