]> git.ipfire.org Git - thirdparty/u-boot.git/commit
common: readline: Fix always true test
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Wed, 25 Jun 2025 09:50:30 +0000 (10:50 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 8 Jul 2025 21:35:49 +0000 (15:35 -0600)
commitebb2c9e5500939cff5e812f54819174bbe6703df
treee886bd8d4c07bbfdd426901aaae01e888c6b2efb
parent3833600dbaa2d7008063f3127abf21be8f0fe6cd
common: readline: Fix always true test

The variable base is unsigned so >= 0 is always true. Fix this test
so that it is actually useful. The fix prevents the code from causing
a segfault in the case where Ctrl-w is pressed on a line consisting
only of spaces.

Fixes: dcc18ce0dbaf ("cli: Implement delete-word in cread_line()")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
common/cli_readline.c