Opened 10 years ago

Closed 10 years ago

#8082 closed Bugs (fixed)

Unused function w32_cat_get() in regex

Reported by: pjtsu Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description

I think w32_cat_get() in w32_regex_traits.cpp is unused by regex.
w32_cat_get() calls LoadStringA() and LoadStringW() of USER32.dll.
If w32_cat_get() is deleted, libboost_regex-*.lib can link to just only KERNEL32.dll.

If w32_cat_get() remains, I think revision is necessary.
Destination buffer of WideCharToMultiByte() in w32_regex_traits.cpp may be shortage,
because not a letter of all MultiByte-CodePages are in 2 bytes.
Constant value MB_LEN_MAX should be instead of 2.
MB_LEN_MAX is in <climits> header.

Change History (2)

comment:1 by anonymous, 10 years ago

The functions are potentially called from the header.

I'll change the code to let WideCharToMultiByte itself determine the buffer size.

BTW WideCharToMultiByte is only used on systems with no narrow character Win32 API's such as WinCE.

comment:2 by John Maddock, 10 years ago

Resolution: fixed
Status: newclosed

(In [83967]) Fix buffer size determination. Fixes #8082.

Note: See TracTickets for help on using tickets.