Merge pull request #1755 from ebraminio/slim

Don't use vsnprintf when HB_NO_BUFFER_MESSAGE is defined
This commit is contained in:
Ebrahim Byagowi 2019-06-05 12:57:28 +04:30 committed by GitHub
commit 4b1b0bf2f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -2026,6 +2026,9 @@ hb_buffer_set_message_func (hb_buffer_t *buffer,
bool bool
hb_buffer_t::message_impl (hb_font_t *font, const char *fmt, va_list ap) hb_buffer_t::message_impl (hb_font_t *font, const char *fmt, va_list ap)
{ {
#ifdef HB_NO_BUFFER_MESSAGE
return false;
#endif
char buf[100]; char buf[100];
vsnprintf (buf, sizeof (buf), fmt, ap); vsnprintf (buf, sizeof (buf), fmt, ap);
return (bool) this->message_func (this, font, buf, this->message_data); return (bool) this->message_func (this, font, buf, this->message_data);

View File

@ -52,6 +52,7 @@
#define HB_DISABLE_DEPRECATED #define HB_DISABLE_DEPRECATED
#define HB_NDEBUG #define HB_NDEBUG
#define HB_NO_ATEXIT #define HB_NO_ATEXIT
#define HB_NO_BUFFER_MESSAGE
#define HB_NO_BUFFER_SERIALIZE #define HB_NO_BUFFER_SERIALIZE
#define HB_NO_BITMAP #define HB_NO_BITMAP
#define HB_NO_CFF #define HB_NO_CFF