summaryrefslogtreecommitdiff
path: root/Objects/stringlib/count.h
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2006-05-30 17:39:58 +0000
committerFredrik Lundh <fredrik@pythonware.com>2006-05-30 17:39:58 +0000
commit9e9ef9fa5a789f02a04c08998c4b74af9686e43a (patch)
treeb91231451b625b956e3d7fd3e7d6212672a0479d /Objects/stringlib/count.h
parent4182a755717a6c05637ec1a44445e4524102928b (diff)
downloadcpython-git-9e9ef9fa5a789f02a04c08998c4b74af9686e43a.tar.gz
changed count to return 0 for slices outside the source string
Diffstat (limited to 'Objects/stringlib/count.h')
-rw-r--r--Objects/stringlib/count.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringlib/count.h b/Objects/stringlib/count.h
index 84a852f52e..367a15c51a 100644
--- a/Objects/stringlib/count.h
+++ b/Objects/stringlib/count.h
@@ -15,7 +15,7 @@ stringlib_count(const STRINGLIB_CHAR* str, Py_ssize_t str_len,
if (sub_len == 0) {
if (str_len < 0)
- return 1; /* start >= len(str) */
+ return 0; /* start > len(str) */
return str_len + 1;
}