File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 6
6
#ifndef MPL_FT2FONT_H
7
7
#define MPL_FT2FONT_H
8
8
9
- #include < filesystem>
10
9
#include < set>
11
10
#include < string>
12
11
#include < string_view>
@@ -42,11 +41,12 @@ inline char const* ft_error_string(FT_Error error) {
42
41
43
42
// No more than 16 hex digits + "0x" + null byte for a 64-bit int error.
44
43
#define THROW_FT_ERROR (name, err ) { \
44
+ std::string path{__FILE__}; \
45
45
char buf[20 ] = {0 }; \
46
- sprintf ( buf, " %#04x" , err); \
46
+ snprintf (buf, sizeof buf, " %#04x" , err); \
47
47
throw std::runtime_error{ \
48
48
name " (" \
49
- + std::filesystem:: path(__FILE__). filename (). string ( ) \
49
+ + path. substr (path. find_last_of ( " / \\ " ) + 1 ) \
50
50
+ " line " + std::to_string (__LINE__) + " ) failed with error " \
51
51
+ std::string{buf} + " : " + std::string{ft_error_string (err)}}; \
52
52
} (void )0
You can’t perform that action at this time.
0 commit comments