Index: gcode.c =================================================================== --- gcode.c (revision 28094) +++ gcode.c (revision 28095) @@ -277,7 +277,7 @@ /* Set entire array to 0 (don't export any layer groups by default */ memset(gcode_export_group, 0, sizeof(gcode_export_group)); - for (n = 0; n < pcb_max_layer; n++) { + for (n = 0; n < pcb_max_layer(PCB); n++) { unsigned int flags = pcb_layer_flags(PCB, n); if (flags & PCB_LYT_SILK) continue;