fix for incorrect (partial) written sequences when libc wcwidth() == -1