Index: obj_text.h =================================================================== --- obj_text.h (revision 7832) +++ obj_text.h (revision 7833) @@ -82,7 +82,7 @@ #define PCB_TEXT_ALL_LOOP(top) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (top)->Layer; \ - for (l = 0; l < (top)->LayerN; l++, layer++) \ + for (l = 0; l < ((top)->LayerN > 0 ? (top)->LayerN : PCB->Data->LayerN); l++, layer++) \ { \ PCB_TEXT_LOOP(layer) @@ -89,7 +89,7 @@ #define PCB_TEXT_VISIBLE_LOOP(board) do { \ pcb_cardinal_t l; \ pcb_layer_t *layer = (board)->Data->Layer; \ - for (l = 0; l < (board)->Data->LayerN; l++, layer++) \ + for (l = 0; l < ((board)->Data->LayerN > 0 ? (board)->Data->LayerN : PCB->Data->LayerN); l++, layer++) \ { \ PCB_TEXT_LOOP(layer); \ if (pcb_text_is_visible((board), layer, text))