From 41cef6cb131c43e5429593ae99ef54d5e90ef603 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Thu, 29 Mar 2012 05:28:09 +0000 Subject: Make sure font glyph shader names are null-terminated. --- src/renderer/tr_font.c | 4 ++-- 1 file 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); -- cgit