Skip to content

Commit feff538

Browse files
committed
ext/tidy: Reduce scope of variable and rename to prevent variable shadowing
1 parent 2505781 commit feff538

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

ext/tidy/tidy.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,17 +666,16 @@ static void tidy_add_node_default_properties(PHPTidyObj *obj)
666666
tempattr = tidyAttrFirst(obj->node);
667667

668668
if (tempattr) {
669-
const char *name, *val;
670669
array_init(&attribute);
671670

672671
do {
673-
name = (const char *)tidyAttrName(tempattr);
674-
val = (const char *)tidyAttrValue(tempattr);
675-
if (name) {
672+
const char *attr_name = tidyAttrName(tempattr);
673+
if (attr_name) {
674+
const char *val = tidyAttrValue(tempattr);
676675
if (val) {
677-
add_assoc_string(&attribute, name, val);
676+
add_assoc_string(&attribute, attr_name, val);
678677
} else {
679-
add_assoc_str(&attribute, name, zend_empty_string);
678+
add_assoc_str(&attribute, attr_name, zend_empty_string);
680679
}
681680
}
682681
} while((tempattr = tidyAttrNext(tempattr)));

0 commit comments

Comments
 (0)