[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH] * geandert wegen codestil.txt
---
src/modules/c/getip/main.c | 34 ++++++++++++++++------------------
1 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/src/modules/c/getip/main.c b/src/modules/c/getip/main.c
index 754ccd7..865e586 100644
--- a/src/modules/c/getip/main.c
+++ b/src/modules/c/getip/main.c
@@ -42,28 +42,26 @@
-int
- main ( int argc , char* argv[] )
+int main(int argc, char* argv[])
{
- printf( "getip\n-----\n\n" );
+ printf("getip\n-----\n\n");
- if( argc != 2 )
- {
- printf ( "Incorrect usage!\n" );
- return 0;
- }
+ if(argc != 2) {
+ printf("Incorrect usage!\n");
+ printf("Correct usage:\tgetip <hostname>\n");
+ return 0;
+ }
- struct in_addr addr;
+ struct in_addr addr;
- struct hostent* info;
- info = gethostbyname( argv[1] );
- int i = 0;
- while ( info->h_addr_list[i] != 0 )
- {
- addr.s_addr = *( unsigned long *) info->h_addr_list[i++];
+ struct hostent* info;
+ info = gethostbyname(argv[1]);
+ int i = 0;
+ while (info->h_addr_list[i] != 0) {
+ addr.s_addr = *(unsigned long *)info->h_addr_list[i++];
- printf( "IP Address: %s \n" , inet_ntoa( addr ) );
- }
+ printf("IP Address: %s\n" , inet_ntoa(addr));
+ }
- return 0;
+ return 0;
}
--
1.6.0.4