]> granicus.if.org Git - graphviz/commitdiff
smyrna new_attr_ref: remove shadowing of global 'attr'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 21 Dec 2022 05:07:47 +0000 (21:07 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Dec 2022 19:42:15 +0000 (11:42 -0800)
cmd/smyrna/gui/frmobjectui.c

index 0cd6cd145f221ff10bc549d06d8b9fcbaa878715..67093b5a8910c3b7bc7595a1ac012ecacfdff654 100644 (file)
@@ -100,15 +100,15 @@ static attr_t *new_attr_with_ref(Agsym_t * sym)
 
 static attr_t *new_attr_ref(attr_t * refAttr)
 {
-    attr_t *attr = gv_alloc(sizeof(attr_t));
-    *attr = *refAttr;
-    attr->defValG = safestrdup(refAttr->defValG);
-    attr->defValN = safestrdup(refAttr->defValN);
-    attr->defValE = safestrdup(refAttr->defValE);
-    attr->name = safestrdup(refAttr->name);
+    attr_t *a = gv_alloc(sizeof(attr_t));
+    *a = *refAttr;
+    a->defValG = safestrdup(refAttr->defValG);
+    a->defValN = safestrdup(refAttr->defValN);
+    a->defValE = safestrdup(refAttr->defValE);
+    a->name = safestrdup(refAttr->name);
     if (refAttr->value)
-       attr->value = safestrdup(refAttr->value);
-    return attr;
+       a->value = safestrdup(refAttr->value);
+    return a;
 }
 
 static void reset_attr_list_widgets(attr_list * l)