Commit c858714 1 parent b2d478d commit c858714 Copy full SHA for c858714
File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,9 @@ namespace vx::string_utils {
241
241
std::size_t size = _size;
242
242
if ( !size ) {
243
243
244
+ #if defined __linux__ && defined __clang__ && __clang_major__ >= 18
245
+ size = std::strlen ( reinterpret_cast <const char *>( _uchr ) );
246
+ #else
244
247
std::basic_string<unsigned char > string {};
245
248
try {
246
249
@@ -250,10 +253,11 @@ namespace vx::string_utils {
250
253
251
254
logFatal () << _exception.what ();
252
255
}
253
- #ifdef _WIN32
256
+ #ifdef _WIN32
254
257
size = std::strnlen_s ( reinterpret_cast <const char *>( _uchr ), string.size () ); // NOSONAR do not use reinterpret_cast.
255
- #else
258
+ #else
256
259
size = std::strnlen ( reinterpret_cast <const char *>( _uchr ), string.size () ); // NOSONAR do not use reinterpret_cast.
260
+ #endif
257
261
#endif
258
262
}
259
263
return std::make_optional<std::string>( _uchr, _uchr + size ); // NOSONAR do not use pointer arithmetic.
You can’t perform that action at this time.
0 commit comments