the two have drifted apart, so check the limit as each character is
read instead of correcting the count afterwards
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Idad62990843d58dfa13a69667295285ba4c7227f
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12715
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit bbb65e562218787fcc6527aa1e3683017f962eca)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211278
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 5b42ac7163)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211284