minor-fix : ensure null-terminating the buffer after a copy

(not really necessary but expected)