It was not copying the terminating \0 in the string, breaking output in spinbutton (didn't try scale). Fixes #3452.
(cherry picked from commit ae2ef147)