summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-08-26 14:58:03 (GMT)
committerGuido van Rossum <guido@python.org>1996-08-26 14:58:03 (GMT)
commite5920bc4c67ca8c12b3dd87b1047e144c2f3b3c3 (patch)
treef2132b33a621488fccaa5a6432f0c59aac8482ed /Objects/classobject.c
parentdd6798c6917c82a04f13083e583cd49ec1442fa8 (diff)
downloadcpython-e5920bc4c67ca8c12b3dd87b1047e144c2f3b3c3.zip
cpython-e5920bc4c67ca8c12b3dd87b1047e144c2f3b3c3.tar.gz
cpython-e5920bc4c67ca8c12b3dd87b1047e144c2f3b3c3.tar.bz2
Use getstringsize where available instead of strlen.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 191b556..9b12d18 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;