Fixed off-by-one error when setting clipboard text length