From efbe9863a28dc094f40201c737a1a4927c062b5b Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Fri, 21 Apr 2023 11:29:12 +0200 Subject: EXIT_SUCCESS.3const: EXAMPLES: Do not use assignment in if condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: checkpatch(1) (`make lint-c-checkpatch`) Reported-by: Ahelenia ZiemiaƄska Signed-off-by: Alejandro Colomar --- man3const/EXIT_SUCCESS.3const | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const index fd3595f83..431f43bbb 100644 --- a/man3const/EXIT_SUCCESS.3const +++ b/man3const/EXIT_SUCCESS.3const @@ -43,7 +43,8 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - if ((fp = fopen(argv[1], "r")) == NULL) { + fp = fopen(argv[1], "r"); + if (fp == NULL) { perror(argv[1]); exit(EXIT_FAILURE); } -- cgit v1.2.3