]> granicus.if.org Git - python/commitdiff
Test for zero-length argument in capitalize().
authorGuido van Rossum <guido@python.org>
Mon, 17 Jun 1996 16:59:33 +0000 (16:59 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 17 Jun 1996 16:59:33 +0000 (16:59 +0000)
Modules/stropmodule.c

index 52d4cee3668392c5f6a5a3a76204a3a6c2ecee2e..069d5f444799a800cab488ecfbf500ee7dffc734 100644 (file)
@@ -384,7 +384,7 @@ strop_capitalize(self, args)
                return NULL;
        s_new = getstringvalue(new);
        changed = 0;
-       {
+       if (0 < n) {
                int c = Py_CHARMASK(*s++);
                if (islower(c)) {
                        changed = 1;