tools/tiff2bw.c:91: error: Integer Overflow L2
  ([0, `n`] - 1):unsigned32.

tools/tiff2bw.c:86:1: <LHS trace>
84. }
85. 
86. static void
    ^
87. compresspalette(unsigned char* out, unsigned char* data, uint32 n, uint16* rmap, uint16* gmap, uint16* bmap)
88. {

tools/tiff2bw.c:86:1: Parameter `n`
84. }
85. 
86. static void
    ^
87. compresspalette(unsigned char* out, unsigned char* data, uint32 n, uint16* rmap, uint16* gmap, uint16* bmap)
88. {

tools/tiff2bw.c:91:9: Binary operation: ([0, n] - 1):unsigned32
89. 	register int v, red = RED, green = GREEN, blue = BLUE;
90. 
91. 	while (n-- > 0) {
            ^
92. 		unsigned int ix = *data++;
93. 		v = red*rmap[ix];

static void
compresspalette(unsigned char* out, unsigned char* data, uint32 n, uint16* rmap, uint16* gmap, uint16* bmap)
{
	register int v, red = RED, green = GREEN, blue = BLUE;
	while (n-- > 0) {
		unsigned int ix = *data++;
		v = red*rmap[ix];
		v += green*gmap[ix];
		v += blue*bmap[ix];
		*out++ = v>>8;
	}
}
['static void\ncompresspalette(unsigned char* out, unsigned char* data, uint32 n, uint16* rmap, uint16* gmap, uint16* bmap)\n{\n\tregister int v, red = RED, green = GREEN, blue = BLUE;\n\twhile (n-- > 0) {\n\t\tunsigned int ix = *data++;\n\t\tv = red*rmap[ix];\n\t\tv += green*gmap[ix];\n\t\tv += blue*bmap[ix];\n\t\t*out++ = v>>8;\n\t}\n}']