¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

[PATCH v4 3/5] cmd: bcb: change strcmp() usage style in the do_bcb_ab_select()


Dmitry Rokosov
 

In the entire cmd/bcb.c file, the return value of strcmp() is not
directly compared to 0. Therefore, it would be better to maintain this
style in the new do_bcb_ab_select() function as well.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@...>
Reviewed-by: Simon Glass <sjg@...>
Tested-by: Guillaume La Roque <glaroque@...>
Signed-off-by: Dmitry Rokosov <ddrokosov@...>
---
cmd/bcb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/bcb.c b/cmd/bcb.c
index bf28726da91134fa287ca8aada884ed74ecc8f2b..3935b7f8d535e87593020b91a6b37d7c5ef02a83 100644
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -439,7 +439,7 @@ static int do_bcb_ab_select(struct cmd_tbl *cmdtp, int flag, int argc,
bool dec_tries = true;

for (int i = 4; i < argc; i++) {
- if (strcmp(argv[i], "--no-dec") == 0)
+ if (!strcmp(argv[i], "--no-dec"))
dec_tries = false;
else
return CMD_RET_USAGE;

--
2.43.0

Join [email protected] to automatically receive all group messages.