Index: uspace/app/nettest2/nettest2.c
===================================================================
--- uspace/app/nettest2/nettest2.c	(revision a2e3ee6092cd450ed63e80fa45ddb46a740aa02c)
+++ uspace/app/nettest2/nettest2.c	(revision b5cf742a59181f253244bd8f695f588d137834ed)
@@ -55,8 +55,8 @@
 
 /** Echo module name. */
-#define NAME	"Nettest2"
+#define NAME  "nettest2"
 
 /** Packet data pattern. */
-#define NETTEST2_TEXT	"Networking test 2 - transfer"
+#define NETTEST2_TEXT  "Networking test 2 - transfer"
 
 static size_t size;
@@ -107,7 +107,5 @@
 static void nettest2_fill_buffer(char *buffer, size_t size)
 {
-	size_t length;
-
-	length = 0;
+	size_t length = 0;
 	while (size > length + sizeof(NETTEST2_TEXT) - 1) {
 		memcpy(buffer + length, NETTEST2_TEXT,
@@ -115,5 +113,5 @@
 		length += sizeof(NETTEST2_TEXT) - 1;
 	}
-
+	
 	memcpy(buffer + length, NETTEST2_TEXT, size - length);
 	buffer[size] = '\0';
@@ -130,5 +128,5 @@
 	int value;
 	int rc;
-
+	
 	switch (argv[*index][1]) {
 	/*
@@ -136,17 +134,19 @@
 	 */
 	case 'f':
-		rc = arg_parse_name_int(argc, argv, index, &family, 0,
+		rc = arg_parse_name_int(argc, argv, index, &value, 0,
 		    socket_parse_protocol_family);
 		if (rc != EOK)
 			return rc;
+		
+		family = (uint16_t) value;
 		break;
 	case 'h':
 		nettest2_print_help();
 		return EOK;
-		break;
 	case 'm':
 		rc = arg_parse_int(argc, argv, index, &messages, 0);
 		if (rc != EOK)
 			return rc;
+		
 		break;
 	case 'n':
@@ -154,4 +154,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		break;
 	case 'p':
@@ -159,4 +160,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		port = (uint16_t) value;
 		break;
@@ -165,4 +167,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		size = (value >= 0) ? (size_t) value : 0;
 		break;
@@ -172,4 +175,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		type = (sock_type_t) value;
 		break;
@@ -177,4 +181,5 @@
 		verbose = true;
 		break;
+	
 	/*
 	 * Long options with double dash ('-')
@@ -182,8 +187,10 @@
 	case '-':
 		if (str_lcmp(argv[*index] + 2, "family=", 7) == 0) {
-			rc = arg_parse_name_int(argc, argv, index, &family, 9,
+			rc = arg_parse_name_int(argc, argv, index, &value, 9,
 			    socket_parse_protocol_family);
 			if (rc != EOK)
 				return rc;
+			
+			family = (uint16_t) value;
 		} else if (str_lcmp(argv[*index] + 2, "help", 5) == 0) {
 			nettest2_print_help();
@@ -201,4 +208,5 @@
 			if (rc != EOK)
 				return rc;
+			
 			port = (uint16_t) value;
 		} else if (str_lcmp(argv[*index] + 2, "type=", 5) == 0) {
@@ -207,4 +215,5 @@
 			if (rc != EOK)
 				return rc;
+			
 			type = (sock_type_t) value;
 		} else if (str_lcmp(argv[*index] + 2, "verbose", 8) == 0) {
@@ -219,5 +228,5 @@
 		return EINVAL;
 	}
-
+	
 	return EOK;
 }
@@ -266,5 +275,5 @@
 		}
 	}
-
+	
 	/* If not before the last argument containing the host */
 	if (index >= argc) {
@@ -312,5 +321,5 @@
 		}
 	}
-
+	
 	/* Check data buffer size. */
 	if (size <= 0) {
@@ -319,5 +328,5 @@
 		size = 1024;
 	}
-
+	
 	/*
 	 * Prepare the buffer. Allocate size bytes plus one for terminating
@@ -329,8 +338,8 @@
 		return ENOMEM;
 	}
-
+	
 	/* Fill buffer with a pattern. */
 	nettest2_fill_buffer(data, size);
-
+	
 	/* Check socket count. */
 	if (sockets <= 0) {
@@ -339,5 +348,5 @@
 		sockets = 2;
 	}
-
+	
 	/*
 	 * Prepare the socket buffer.
@@ -350,12 +359,12 @@
 	}
 	socket_ids[sockets] = 0;
-
+	
 	if (verbose)
 		printf("Starting tests\n");
-
+	
 	rc = sockets_create(verbose, socket_ids, sockets, family, type);
 	if (rc != EOK)
 		return rc;
-
+	
 	if (type == SOCK_STREAM) {
 		rc = sockets_connect(verbose, socket_ids, sockets,
@@ -364,8 +373,8 @@
 			return rc;
 	}
-
+	
 	if (verbose)
 		printf("\n");
-
+	
 	rc = gettimeofday(&time_before, NULL);
 	if (rc != EOK) {
@@ -373,10 +382,10 @@
 		return rc;
 	}
-
+	
 	rc = sockets_sendto_recvfrom(verbose, socket_ids, sockets, address,
 	    &addrlen, data, size, messages);
 	if (rc != EOK)
 		return rc;
-
+	
 	rc = gettimeofday(&time_after, NULL);
 	if (rc != EOK) {
@@ -384,11 +393,11 @@
 		return rc;
 	}
-
+	
 	if (verbose)
 		printf("\tOK\n");
-
+	
 	printf("sendto + recvfrom tested in %ld microseconds\n",
 	    tv_sub(&time_after, &time_before));
-
+	
 	rc = gettimeofday(&time_before, NULL);
 	if (rc != EOK) {
@@ -396,15 +405,15 @@
 		return rc;
 	}
-
+	
 	rc = sockets_sendto(verbose, socket_ids, sockets, address, addrlen,
 	    data, size, messages);
 	if (rc != EOK)
 		return rc;
-
+	
 	rc = sockets_recvfrom(verbose, socket_ids, sockets, address, &addrlen,
 	    data, size, messages);
 	if (rc != EOK)
 		return rc;
-
+	
 	rc = gettimeofday(&time_after, NULL);
 	if (rc != EOK) {
@@ -412,18 +421,18 @@
 		return rc;
 	}
-
+	
 	if (verbose)
 		printf("\tOK\n");
-
+	
 	printf("sendto, recvfrom tested in %ld microseconds\n",
 	    tv_sub(&time_after, &time_before));
-
+	
 	rc = sockets_close(verbose, socket_ids, sockets);
 	if (rc != EOK)
 		return rc;
-
+	
 	if (verbose)
 		printf("\nExiting\n");
-
+	
 	return EOK;
 }
