Index: obj_line.h =================================================================== --- obj_line.h (revision 7775) +++ obj_line.h (revision 7776) @@ -99,7 +99,7 @@ #define PCB_LINE_ALL_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - for (l = 0; l < pcb_max_layer; l++, layer++) \ + for (l = 0; l < (top)->LayerN; l++, layer++) \ { \ PCB_LINE_LOOP(layer) @@ -106,7 +106,7 @@ #define PCB_LINE_COPPER_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - for (l = 0; l < pcb_max_layer; l++, layer++) \ + for (l = 0; l < (top)->LayerN; l++, layer++) \ { \ if (!(pcb_layer_flags(l) & PCB_LYT_COPPER)) continue; \ PCB_LINE_LOOP(layer) @@ -114,7 +114,7 @@ #define PCB_LINE_SILK_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - for (l = 0; l < pcb_max_layer; l++, layer++) \ + for (l = 0; l < (top)->LayerN; l++, layer++) \ { \ if (!(pcb_layer_flags(l) & PCB_LYT_SILK)) continue; \ PCB_LINE_LOOP(layer) @@ -122,7 +122,7 @@ #define PCB_LINE_VISIBLE_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - for (l = 0; l < pcb_max_layer; l++, layer++) \ + for (l = 0; l < (top)->LayerN; l++, layer++) \ { \ if (layer->On) \ PCB_LINE_LOOP(layer)