[Boost-bugs] [Boost C++ Libraries] #4201: boost/asio/detail/socket_ops.hpp:1305: isdigit called with char, not unsigned char

Subject: [Boost-bugs] [Boost C++ Libraries] #4201: boost/asio/detail/socket_ops.hpp:1305: isdigit called with char, not unsigned char
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-05-07 22:14:44


#4201: boost/asio/detail/socket_ops.hpp:1305: isdigit called with char, not
unsigned char
--------------------------+-------------------------------------------------
 Reporter: anonymous | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: asio
  Version: Boost 1.43.0 | Severity: Problem
 Keywords: |
--------------------------+-------------------------------------------------
 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[0], 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4201>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC