commands: Fix memory allocation in assign
commands: Fix memory allocation in assign

Also use the safer snprintf since we just computed the size.

Signed-off-by: Quentin Glidic <241385a0e41ea713327e189bce1062decf7c1eb5@sardemff7.net>

4e554c4c/sway,1ace/sway,taiyu-len/sway,mikkeloscar/sway,ascent12/sway,1ace/sway,johalun/sway,crondog/sway,taiyu-len/sway,mikkeloscar/sway,sleep-walker/sway,sleep-walker/sway,ascent12/sway,crondog/sway,SirCmpwn/sway,ascent12/sway,1ace/sway,taiyu-len/sway,ptMuta/sway,4e554c4c/sway