Skip to content

Commit fa05169

Browse files
committed
Use PyOS_snprintf
1 parent 3f9dbd2 commit fa05169

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ft2font.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ FT2Font::get_glyph_name(const Py::Tuple & args)
16231623
{
16241624
/* Note that this generated name must match the name that
16251625
is generated by ttconv in ttfont_CharStrings_getname. */
1626-
snprintf(buffer, 128, "uni%08x", glyph_number);
1626+
PyOS_snprintf(buffer, 128, "uni%08x", glyph_number);
16271627
} else {
16281628
if (FT_Get_Glyph_Name(face, glyph_number, buffer, 128))
16291629
{

ttconv/pprdrv_tt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "pprdrv.h"
3232
#include "truetype.h"
3333
#include <sstream>
34+
#include <Python.h>
3435

3536
/*==========================================================================
3637
** Convert the indicated Truetype font file to a type 42 or type 3
@@ -999,7 +1000,7 @@ const char *ttfont_CharStrings_getname(struct TTFONT *font, int charindex)
9991000
/* We don't have a glyph name table, so generate a name.
10001001
This generated name must match exactly the name that is
10011002
generated by FT2Font in get_glyph_name */
1002-
snprintf(temp, 80, "uni%08x", charindex);
1003+
PyOS_snprintf(temp, 80, "uni%08x", charindex);
10031004
return temp;
10041005
}
10051006

0 commit comments

Comments
 (0)