summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-04-21 11:29:12 +0200
committerAlejandro Colomar <alx@kernel.org>2023-04-21 11:29:54 +0200
commitefbe9863a28dc094f40201c737a1a4927c062b5b (patch)
treeb87ac4ee55fa34b8ba43141737d1e5218727b559
parent8af0181362a655ff23eef82558d5c5be63b1d793 (diff)
EXIT_SUCCESS.3const: EXAMPLES: Do not use assignment in if condition
Reported-by: checkpatch(1) (`make lint-c-checkpatch`) Reported-by: Ahelenia ZiemiaƄska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man3const/EXIT_SUCCESS.3const3
1 files changed, 2 insertions, 1 deletions
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);
}