summaryrefslogtreecommitdiff
path: root/hwpfilter/source/hfont.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'hwpfilter/source/hfont.cxx')
-rw-r--r--hwpfilter/source/hfont.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/hwpfilter/source/hfont.cxx b/hwpfilter/source/hfont.cxx
index e5c23a88199b..1a96b1797463 100644
--- a/hwpfilter/source/hfont.cxx
+++ b/hwpfilter/source/hfont.cxx
@@ -47,7 +47,9 @@ void HWPFont::AddFont(int lang, const char *font)
nfonts = nFonts[lang];
if (MAXFONTS <= nfonts)
return;
- strncpy(fontnames[lang].get() + FONTNAMELEN * nfonts, font, FONTNAMELEN - 1);
+ auto const p = fontnames[lang].get() + FONTNAMELEN * nfonts;
+ strncpy(p, font, FONTNAMELEN - 1);
+ p[FONTNAMELEN - 1] = '\0'; // just in case, even though the array is zero-initialized
nFonts[lang]++;
}