new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / shared / tests / hash_test.c
old mode 100755 (executable)
new mode 100644 (file)
index d1464cf..eca69b9
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <string.h>
+
 #include "hash_op.h"
 
 
@@ -9,31 +10,27 @@ int main(int argc, char **argv)
     char *tmp;
     char buf[1024];
     OSHash *mhash;
-    
+
     mhash = OSHash_Create();
 
-    while(1)
-    {
+    while (1) {
         fgets(buf, 1024, stdin);
         tmp = strchr(buf, '\n');
-        if(tmp)
+        if (tmp) {
             *tmp = '\0';
+        }
 
-        if(strncmp(buf, "get ", 4) == 0)
-        {
+        if (strncmp(buf, "get ", 4) == 0) {
             printf("Getting key: '%s'\n", buf + 4);
-            printf("Found: '%s'\n", (char *)OSHash_Get(mhash, buf + 4));   
-        }
-        else
-        {
+            printf("Found: '%s'\n", (char *)OSHash_Get(mhash, buf + 4));
+        } else {
             printf("Adding key: '%s'\n", buf);
             i = OSHash_Add(mhash, strdup(buf), strdup(buf));
-            
+
             printf("rc = %d\n", i);
         }
     }
-    return(0);
-}
 
+    return (0);
+}
 
-/* EOF */