Move *-main to progs
Do not write past the end of string