diff --git a/src/common/windows/unicode.hpp b/src/common/windows/unicode.hpp index f3bca6f48..418a206df 100644 --- a/src/common/windows/unicode.hpp +++ b/src/common/windows/unicode.hpp @@ -13,6 +13,11 @@ static inline void ffStrbufInitWSV(FFstrbuf* result, const std::wstring_view sou return ffStrbufInitNWS(result, (uint32_t) source.size(), source.data()); } +static inline FFstrbuf ffStrbufCreateWSV(const std::wstring_view source) +{ + return ffStrbufCreateNWS((uint32_t) source.size(), source.data()); +} + static inline void ffStrbufSetWSV(FFstrbuf* result, const std::wstring_view source) { return ffStrbufSetNWS(result, (uint32_t) source.size(), source.data()); diff --git a/src/detection/bluetooth/bluetooth_windows.cpp b/src/detection/bluetooth/bluetooth_windows.cpp index f4ac9c9c7..b54882d61 100644 --- a/src/detection/bluetooth/bluetooth_windows.cpp +++ b/src/detection/bluetooth/bluetooth_windows.cpp @@ -79,8 +79,7 @@ const char* ffBluetoothDetectBattery(FFlist* devices) batt = data.get(); else { - FF_STRBUF_AUTO_DESTROY addr; // MAC address without colon - ffStrbufInitWSV(&addr, data.get()); + FF_STRBUF_AUTO_DESTROY addr = ffStrbufCreateWSV(data.get()); // MAC address without colon if (__builtin_expect(addr.length != 12, 0)) continue;