From: Guido van Rossum Date: Mon, 26 Aug 1996 14:58:03 +0000 (+0000) Subject: Use getstringsize where available instead of strlen. X-Git-Tag: v1.4b3~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e5920bc4c67ca8c12b3dd87b1047e144c2f3b3c3;p=thirdparty%2FPython%2Fcpython.git Use getstringsize where available instead of strlen. --- diff --git a/Objects/classobject.c b/Objects/classobject.c index 191b5568c0e1..9b12d1876a83 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -550,7 +550,7 @@ instance_setattr(inst, name, v) if (sname[0] == '_' && sname[1] == '_' && (strcmp(sname, "__dict__") == 0 || strcmp(sname, "__class__") == 0)) { - int n = strlen(sname); + int n = getstringsize(name); if (sname[n-1] == '_' && sname[n-2] == '_') { err_setstr(TypeError, "read-only special attribute"); return -1;