Ticket #4201 (closed Bugs: fixed)
boost/asio/detail/socket_ops.hpp:1305: isdigit called with char, not unsigned char
|Reported by:||anonymous||Owned by:||chris_kohlhoff|
As of r61840 file boost/asio/detail/socket_ops.hpp at function gai_serv, there is a call on line 1305 to isdigit which passes serv, where serv is declared as a const char*. This causes warning C6328 from the Microsoft code analysis tool PREfast, because isdigit should take an unsigned char, but char is signed if not otherwise specified. Some implementations of ctype.h functions assume that the input is in the range [0, 255], and will misbehave if given a value less than zero. The attached patch requests that the compiler zero-extend the value, which both removes the warning and fixes the problem that the warning is intended to address.