diff --git a/ndn-cpp/c/transport/socket-transport.c b/ndn-cpp/c/transport/socket-transport.c
index d48c794..a6fcbac 100644
--- a/ndn-cpp/c/transport/socket-transport.c
+++ b/ndn-cpp/c/transport/socket-transport.c
@@ -22,9 +22,9 @@
     self->socketDescriptor = -1;
   }
   
-	struct addrinfo hints;
-	ndn_memset((unsigned char *)&hints, 0, sizeof(hints));
-	hints.ai_family = AF_UNSPEC;
+  struct addrinfo hints;
+  ndn_memset((unsigned char *)&hints, 0, sizeof(hints));
+  hints.ai_family = AF_UNSPEC;
   if (socketType == SOCKET_TCP)
     hints.ai_socktype = SOCK_STREAM;
   else if (socketType == SOCKET_UDP)
@@ -35,31 +35,31 @@
   char portString[10];
   sprintf(portString, "%d", port);
   
-	struct addrinfo *serverInfo;
-	if (getaddrinfo(host, portString, &hints, &serverInfo) != 0)
-		return NDN_ERROR_SocketTransport_error_in_getaddrinfo;
+  struct addrinfo *serverInfo;
+  if (getaddrinfo(host, portString, &hints, &serverInfo) != 0)
+    return NDN_ERROR_SocketTransport_error_in_getaddrinfo;
 
-	// loop through all the results and connect to the first we can
-	struct addrinfo *p;
+  // loop through all the results and connect to the first we can
+  struct addrinfo *p;
   int socketDescriptor;
-	for(p = serverInfo; p != NULL; p = p->ai_next) {
-		if ((socketDescriptor = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1)
-			continue;
+  for(p = serverInfo; p != NULL; p = p->ai_next) {
+    if ((socketDescriptor = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1)
+      continue;
 
-		if (connect(socketDescriptor, p->ai_addr, p->ai_addrlen) == -1) {
-			close(socketDescriptor);
-			continue;
-		}
+    if (connect(socketDescriptor, p->ai_addr, p->ai_addrlen) == -1) {
+      close(socketDescriptor);
+      continue;
+    }
 
-		break;
-	}
-
-	if (p == NULL) {
-    freeaddrinfo(serverInfo);
-		return NDN_ERROR_SocketTransport_cannot_connect_to_socket;
+    break;
   }
 
-	freeaddrinfo(serverInfo);
+  if (p == NULL) {
+    freeaddrinfo(serverInfo);
+    return NDN_ERROR_SocketTransport_cannot_connect_to_socket;
+  }
+
+  freeaddrinfo(serverInfo);
   self->socketDescriptor = socketDescriptor;
 
   return NDN_ERROR_success;
@@ -91,12 +91,12 @@
     return NDN_ERROR_SocketTransport_socket_is_not_open;
 
   int nBytes;  
-	if ((nBytes = recv(self->socketDescriptor, buffer, bufferLength, 0)) == -1)
+  if ((nBytes = recv(self->socketDescriptor, buffer, bufferLength, 0)) == -1)
     return NDN_ERROR_SocketTransport_error_in_recv;
 
   *nBytesOut = (unsigned int)nBytes;
   
-	return NDN_ERROR_success;  
+  return NDN_ERROR_success;  
 }
 
 ndn_Error ndn_SocketTransport_close(struct ndn_SocketTransport *self)
