Browse Source

getaddrinfo.c: Avoid misleading indentation warning

When compiling getaddrinfo.c with clang the -Wmisleading-indentation
option will cause a warning due to the indentation lining up with the
previous statement in the if block above.

For gcc the warning is blinded by the commented line. See also:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107162

Move the comment behind the function call to make both compilers happy.
Marcus Haehnel 5 months ago
parent
commit
20d7d58f1a
1 changed files with 1 additions and 2 deletions
  1. 1 2
      libc/inet/getaddrinfo.c

+ 1 - 2
libc/inet/getaddrinfo.c

@@ -959,8 +959,7 @@ getaddrinfo(const char *name, const char *service,
 					last_i = i;
 					if (hints->ai_family == AF_UNSPEC && (i & GAIH_OKIFUNSPEC))
 						continue;
-					/*if (p) - freeaddrinfo works ok on NULL too */
-						freeaddrinfo(p);
+					freeaddrinfo(p); /* freeaddrinfo works ok on NULL too */
 					return -(i & GAIH_EAI);
 				}
 				if (end)