]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
EXIT_SUCCESS.3const: EXAMPLES: Do not use assignment in if condition
authorAlejandro Colomar <alx@kernel.org>
Fri, 21 Apr 2023 09:29:12 +0000 (11:29 +0200)
committerAlejandro Colomar <alx@kernel.org>
Fri, 21 Apr 2023 09:29:54 +0000 (11:29 +0200)
Reported-by: checkpatch(1) (`make lint-c-checkpatch`)
Reported-by: Ahelenia ZiemiaƄska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man3const/EXIT_SUCCESS.3const

index fd3595f83598ce81ddab5b9d44a26a797f7cef41..431f43bbb2efafe0374897e89310bcaf6e155934 100644 (file)
@@ -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);
     }