Allow Size 0 in ping plugin, and fix minor style issues there
authorWitold Baryluk <witold.baryluk@gmail.com>
Wed, 2 Dec 2015 00:51:36 +0000 (01:51 +0100)
committerWitold Baryluk <witold.baryluk@gmail.com>
Wed, 2 Dec 2015 00:52:12 +0000 (01:52 +0100)
src/ping.c

index 7eb2293..cac8a3f 100644 (file)
@@ -547,15 +547,15 @@ static int ping_config (const char *key, const char *value) /* {{{ */
 
     if (ping_data != NULL)
     {
-      free(ping_data);
+      free (ping_data);
       ping_data = NULL;
     }
 
     size = atoi (value);
-    if ((size >= 1) && (size <= 65536))
+    if ((size >= 0) && (size <= 65536))
     {
       int i;
-      ping_data = (char*) malloc(size + 1);
+      ping_data = (char *) malloc(size + 1);
       if (ping_data == NULL)
       {
         char errbuf[1024];