]> git.baikalelectronics.ru Git - kernel.git/commit
auxdisplay: charlcd: fix x/y command parsing
authorMans Rullgard <mans@mansr.com>
Wed, 5 Dec 2018 13:52:47 +0000 (13:52 +0000)
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Fri, 21 Dec 2018 20:27:21 +0000 (21:27 +0100)
commit7a04b46bb81278a2b6789608b8bbdc34001846df
tree9f48273fc6e90ce8d11fdf88c2b8500f29ff205b
parent040365dedd26c4b11dfe5f61c260f498a9da8912
auxdisplay: charlcd: fix x/y command parsing

The x/y command parsing has been broken since commit 29b8eb8ed8d7
("staging: panel: Fixed checkpatch warning about simple_strtoul()").

Commit 3a5ad0adf20e ("auxdisplay: charlcd: Fix and clean up handling of
x/y commands") fixed some problems by rewriting the parsing code,
but also broke things further by removing the check for a complete
command before attempting to parse it.  As a result, parsing is
terminated at the first x or y character.

This reinstates the check for a final semicolon.  Whereas the original
code use strchr(), this is wasteful seeing as the semicolon is always
at the end of the buffer.  Thus check this character directly instead.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
drivers/auxdisplay/charlcd.c