UPSTREAM: libpayload/.../PDCurses: Improve compatibility with ncurses

Coverity erroneously complains that we call wmove with x or y == -1,
even though our copy of that function properly checks for that.

But: setsyx is documented to always return OK (even on errors), so let
it do that. (and make coverity happy in the process)

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1260797
Reviewed-on: https://review.coreboot.org/17836
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>

Change-Id: I1bc9ba2a075037f0e1a855b67a93883978564887
Reviewed-on: https://chromium-review.googlesource.com/420838
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Patrick Georgi 2016-12-13 15:50:23 +01:00 committed by chrome-bot
commit 314b3e9d53

View file

@ -135,9 +135,14 @@ int setsyx(int y, int x)
curscr->_leaveit = TRUE;
return OK;
}
else if (y == -1 || x == -1)
{
return OK;
}
else
{
curscr->_leaveit = FALSE;
return wmove(curscr, y, x);
wmove(curscr, y, x);
return OK;
}
}