diff options
author | Zack Middleton <zturtleman@gmail.com> | 2012-03-29 05:28:09 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-12 20:19:21 +0000 |
commit | 41cef6cb131c43e5429593ae99ef54d5e90ef603 (patch) | |
tree | ffefaf855ceb032db48067f14df3e6c50b8c523c | |
parent | 4d0ed9ce8bde63a40c98b495f66f6c0411e84b23 (diff) |
Make sure font glyph shader names are null-terminated.
-rw-r--r-- | src/renderer/tr_font.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/renderer/tr_font.c b/src/renderer/tr_font.c index 25954b66..02ccb80f 100644 --- a/src/renderer/tr_font.c +++ b/src/renderer/tr_font.c @@ -398,8 +398,8 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) { font->glyphs[i].s2 = readFloat(); font->glyphs[i].t2 = readFloat(); font->glyphs[i].glyph = readInt(); - Com_Memcpy(font->glyphs[i].shaderName, &fdFile[fdOffset], 32); - fdOffset += 32; + Q_strncpyz(font->glyphs[i].shaderName, (const char *)&fdFile[fdOffset], sizeof(font->glyphs[i].shaderName)); + fdOffset += sizeof(font->glyphs[i].shaderName); } font->glyphScale = readFloat(); Com_Memcpy(font->name, &fdFile[fdOffset], MAX_QPATH); |