PIC18F UART transmit not stopping
The code execution repeats after returning from main(), which explains the repeating transfer, and the while loop stops that.
The execution happens twice if the programming interface resets the chip twice during programming.