View | Details | Raw Unified | Return to bug 205707 | Differences between
and this patch

Collapse All | Expand All

(-)b/usr.bin/vtfontcvt/vtfontcvt.c (+12 lines)
Lines 251-260 parse_bdf(FILE *fp, unsigned int map_idx) Link Here
251
	size_t length;
251
	size_t length;
252
	uint8_t bytes[wbytes * height], bytes_r[wbytes * height];
252
	uint8_t bytes[wbytes * height], bytes_r[wbytes * height];
253
	unsigned int curchar = 0, dwidth = 0, i, line;
253
	unsigned int curchar = 0, dwidth = 0, i, line;
254
	unsigned int h, w;
254
255
255
	while ((ln = fgetln(fp, &length)) != NULL) {
256
	while ((ln = fgetln(fp, &length)) != NULL) {
256
		ln[length - 1] = '\0';
257
		ln[length - 1] = '\0';
257
258
259
		if (strncmp(ln, "BBX ", 4) == 0 &&
260
		    sscanf(ln + 4, "%u %u", &w, &h) == 2) {
261
			if (h > height)
262
				errx(1, "BBX height %u too large", h);
263
			if (w > width)
264
				errx(1, "BBX width %u too large", w);
265
			height = h;
266
			width = w;
267
			printf("h,w set to %u %u\n", h, w);
268
		}
269
258
		if (strncmp(ln, "ENCODING ", 9) == 0) {
270
		if (strncmp(ln, "ENCODING ", 9) == 0) {
259
			curchar = atoi(ln + 9);
271
			curchar = atoi(ln + 9);
260
		}
272
		}

Return to bug 205707