diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2019-06-15 09:15:58 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2019-06-15 09:15:58 +0000 |
| commit | cfe607d5bf07971741f27c8dd779b635dcb86688 (patch) | |
| tree | ac151e3ed61e9f569c0134dd75fe40e2c4d93368 /usr.bin | |
| parent | 0b253f2ba45d9467f29fde8d56518f2ae7e9413d (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/vtfontcvt/vtfontcvt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/vtfontcvt/vtfontcvt.c b/usr.bin/vtfontcvt/vtfontcvt.c index d3c43f424839e..d4d17b23e7a9f 100644 --- a/usr.bin/vtfontcvt/vtfontcvt.c +++ b/usr.bin/vtfontcvt/vtfontcvt.c @@ -176,6 +176,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback) glyph_total++; glyph_count[map_idx]++; + /* Return existing glyph if we have an identical one. */ hash = fnv_32_buf(bytes, wbytes * height, FNV1_32_INIT) % FONTCVT_NHASH; SLIST_FOREACH(gl, &glyph_hash[hash], g_hash) { if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { @@ -184,6 +185,7 @@ add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback) } } + /* Allocate new glyph. */ gl = xmalloc(sizeof *gl); gl->g_data = xmalloc(wbytes * height); memcpy(gl->g_data, bytes, wbytes * height); |
