diff -Nur xfstt-1.7/src/xfstt.cc xfstt-1.7.new/src/xfstt.cc --- xfstt-1.7/src/xfstt.cc 2010-05-05 15:26:59.000000000 +0200 +++ xfstt-1.7.new/src/xfstt.cc 2010-05-05 15:44:28.363337556 +0200 @@ -446,11 +446,14 @@ char *fontName = nameBase + ttfn->nameOfs; TPFontName fn; - sprintf(&fn.panose[0][0], "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", + char tmpbuf[sizeof(fn.panose)+1]; /* includes space for terminating \0 */ + sprintf(tmpbuf, "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", ttfn->bFamilyType, ttfn->bSerifStyle, ttfn->bWeight, ttfn->bProportion, ttfn->bContrast, ttfn->bStrokeVariation, ttfn->bArmStyle, ttfn->bLetterForm, ttfn->bMidLine, ttfn->bXHeight); + /* copy only the text, not the terminating \0 */ + memcpy(&fn.panose[0][0], tmpbuf, sizeof(fn.panose)); fn.nameLen = sizeof(TPFontName) + ttfn->nameLen; fn.magic[0] = 'T';