Skip to content

Commit

Permalink
Make sure font glyph shader names are null-terminated.
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Mar 29, 2012
1 parent 94fb80f commit 4b7a623
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/renderer/tr_font.c
Expand Up @@ -397,8 +397,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);
Expand Down

0 comments on commit 4b7a623

Please sign in to comment.