Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 335e6b4

Browse filesBrowse files
authored
Fix FT_CHECK compat with cibuildwheel. (#30123)
1 parent 2918b73 commit 335e6b4
Copy full SHA for 335e6b4

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎src/ft2font.h

Copy file name to clipboardExpand all lines: src/ft2font.h
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#ifndef MPL_FT2FONT_H
77
#define MPL_FT2FONT_H
88

9-
#include <filesystem>
109
#include <set>
1110
#include <string>
1211
#include <string_view>
@@ -42,11 +41,12 @@ inline char const* ft_error_string(FT_Error error) {
4241

4342
// No more than 16 hex digits + "0x" + null byte for a 64-bit int error.
4443
#define THROW_FT_ERROR(name, err) { \
44+
std::string path{__FILE__}; \
4545
char buf[20] = {0}; \
46-
sprintf(buf, "%#04x", err); \
46+
snprintf(buf, sizeof buf, "%#04x", err); \
4747
throw std::runtime_error{ \
4848
name " (" \
49-
+ std::filesystem::path(__FILE__).filename().string() \
49+
+ path.substr(path.find_last_of("/\\") + 1) \
5050
+ " line " + std::to_string(__LINE__) + ") failed with error " \
5151
+ std::string{buf} + ": " + std::string{ft_error_string(err)}}; \
5252
} (void)0

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.