Commit 529c963d authored by Guido van Rossum's avatar Guido van Rossum

Test for zero-length argument in capitalize().

parent 26b310a3
...@@ -384,7 +384,7 @@ strop_capitalize(self, args) ...@@ -384,7 +384,7 @@ strop_capitalize(self, args)
return NULL; return NULL;
s_new = getstringvalue(new); s_new = getstringvalue(new);
changed = 0; changed = 0;
{ if (0 < n) {
int c = Py_CHARMASK(*s++); int c = Py_CHARMASK(*s++);
if (islower(c)) { if (islower(c)) {
changed = 1; changed = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment