Skip to content

Commit a5c3cfa

Browse files
committed
do_strip windows bugfix
switched to use ssize_t (signed) for internal counters, to match the python source. (see Modules/stropmodule.c : do_strip) This addresses a bug uncovered by Laszlo Sebo on Windows, when stripping an empty string.
1 parent 6c7eadc commit a5c3cfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pystring.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ typedef int Py_ssize_t;
249249
///
250250
std::string do_strip( const std::string & str, int striptype, const std::string & chars )
251251
{
252-
std::string::size_type len = str.size(), i, j, charslen = chars.size();
252+
ssize_t len = (ssize_t) str.size(), i, j, charslen = (ssize_t) chars.size();
253253

254254
if ( charslen == 0 )
255255
{

0 commit comments

Comments
 (0)