]> Git Repo - u-boot.git/commit
common: cli_hush: avoid dead code
authorPeng Fan <[email protected]>
Tue, 24 Nov 2015 08:54:21 +0000 (16:54 +0800)
committerTom Rini <[email protected]>
Sat, 5 Dec 2015 23:22:14 +0000 (18:22 -0500)
commitaa722529635c16c52d9d609122fecc96ec8d03e4
treea3797aed6aa85dfcf743d8e10ef30ae701e499d5
parentbc3c89b1308281edceb67051a44026545dc7b505
common: cli_hush: avoid dead code

Condition "(value == NULL && ++value == NULL)" actully will
always return false.

Instead, use condition "(value == NULL || *(value + 1) == 0)" to detect
such expression "c=". To "c=", *(value + 1) is 0, so directly return -1,
but not continue.

Signed-off-by: Peng Fan <[email protected]>
Cc: Rabin Vincent <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
common/cli_hush.c
This page took 0.034615 seconds and 4 git commands to generate.