swrun_*: Restore buffer overflow prevention code that was removed in da00ba1
swrun_*: Simplify commit da00ba1