diff options
| author | Fredrik Lundh <fredrik@pythonware.com> | 2006-05-30 17:39:58 +0000 |
|---|---|---|
| committer | Fredrik Lundh <fredrik@pythonware.com> | 2006-05-30 17:39:58 +0000 |
| commit | 30791613fe44be328eee0bc7bbb85ebb821c4599 (patch) | |
| tree | 5ccbf0e5ac10fb5063d4d8d5f631055585504a7e /Objects | |
| parent | 9b524751f3e8f34e333e351f542b760f55647f5a (diff) | |
| download | cpython-30791613fe44be328eee0bc7bbb85ebb821c4599.tar.gz | |
changed count to return 0 for slices outside the source string
Diffstat (limited to 'Objects')
| -rw-r--r-- | Objects/stringlib/count.h | 2 |
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; } |
