Remove whitespaces
authorSimon Guinot <simon.guinot@sequanux.org>
Thu, 21 Nov 2019 22:07:44 +0000 (23:07 +0100)
committerSimon Guinot <simon.guinot@sequanux.org>
Thu, 21 Nov 2019 22:07:44 +0000 (23:07 +0100)
buffer.c
main.c
net.c

index 0ae72de..fc6b31c 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -84,17 +84,17 @@ int write_buffer_to_file(const char *fname, unsigned char *buff, size_t size)
 
 void dump_buffer(unsigned char *buff, int size)
 {
-        int i;
-
-        fprintf(stderr, "Buffer (%d bytes):\n", size);
-        for (i = 0; i < size; i++) {
-                fprintf(stderr, "%02x", buff[i]);
-                if (i % 16 == 15)
-                        fprintf(stderr, "\n");
-                else if (i % 2 == 1)
-                        fprintf(stderr, " ");
-        }
-        fprintf(stderr, "\n");
+       int i;
+
+       fprintf(stderr, "Buffer (%d bytes):\n", size);
+       for (i = 0; i < size; i++) {
+               fprintf(stderr, "%02x", buff[i]);
+               if (i % 16 == 15)
+                       fprintf(stderr, "\n");
+               else if (i % 2 == 1)
+                       fprintf(stderr, " ");
+       }
+       fprintf(stderr, "\n");
 }
 
 /*
diff --git a/main.c b/main.c
index b67da44..109eabe 100644 (file)
--- a/main.c
+++ b/main.c
@@ -140,5 +140,5 @@ int main(int argc, char *argv[])
        if (run_tests)
                return run_buffer_tests();
 
-        return run_netsum(argv[optind], &ctrl);
+       return run_netsum(argv[optind], &ctrl);
 }
diff --git a/net.c b/net.c
index cfcb04d..217a852 100644 (file)
--- a/net.c
+++ b/net.c
@@ -560,24 +560,25 @@ int run_netsum(char *addr, struct netsum_ctrl *ctrl)
        struct sockaddr_in sin;
        int ret;
 
-        memset(&sin, 0, sizeof(sin));
-
-        if (addr) {
-                if (get_inet_addr(addr, &sin)) {
-                        fprintf(stderr,  
-                                "Failed to convert %s into an IP address\n", addr);
-                        return -1;
-                }
-                ret = addr_is_local(&sin);
-                if (ret < 0)
-                        return ret;
-                if (!ret)
-                        return run_client(&sin, ctrl);
-        } else {
-                sin.sin_family = AF_INET;
-                sin.sin_port = htons(NETSUM_DEFAULT_PORT);
-                sin.sin_addr.s_addr = INADDR_ANY;
-        }
+       memset(&sin, 0, sizeof(sin));
+
+       if (addr) {
+               if (get_inet_addr(addr, &sin)) {
+                       fprintf(stderr,
+                               "Failed to convert %s into an IP address\n",
+                               addr);
+                       return -1;
+               }
+               ret = addr_is_local(&sin);
+               if (ret < 0)
+                       return ret;
+               if (!ret)
+                       return run_client(&sin, ctrl);
+       } else {
+               sin.sin_family = AF_INET;
+               sin.sin_port = htons(NETSUM_DEFAULT_PORT);
+               sin.sin_addr.s_addr = INADDR_ANY;
+       }
 
        return run_server(&sin, ctrl);
 }