Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 11868) +++ trunk/src/layer.c (revision 11869) @@ -848,6 +848,13 @@ return 1; } +void pcb_layer_edit_attrib(pcb_layer_t *layer) +{ + char *buf = pcb_strdup_printf(buf, "Layer %s Attributes", layer->meta.real.name); + pcb_gui->edit_attributes(buf, &(layer->meta.real.Attributes)); + free(buf); +} + static pcb_layer_id_t pcb_layer_get_cached(pcb_layer_id_t *cache, unsigned int loc, unsigned int typ) { pcb_layergrp_t *g; Index: trunk/src/layer.h =================================================================== --- trunk/src/layer.h (revision 11868) +++ trunk/src/layer.h (revision 11869) @@ -258,6 +258,8 @@ /* Modify tree pointers in dst to point to src's; allocates trees for src if they are not yet allocated */ void pcb_layer_link_trees(pcb_layer_t *dst, pcb_layer_t *src); +/* Open the attribute editor for a layer */ +void pcb_layer_edit_attrib(pcb_layer_t *layer); /* list of virtual layers: these are generated by the draw code but do not have a real layer in the array */ Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 11868) +++ trunk/src/object_act.c (revision 11869) @@ -139,10 +139,7 @@ return 1; } } - buf = (char *) malloc(strlen(layer->meta.real.name) + strlen("Layer X Attributes")); - sprintf(buf, "Layer %s Attributes", layer->meta.real.name); - pcb_gui->edit_attributes(buf, &(layer->meta.real.Attributes)); - free(buf); + pcb_layer_edit_attrib(layer); return 0; }