X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=src%2Fshared%2Ftests%2Fhash_test.c;h=eca69b980b0f85a77bbdedb0cf4e70475cf1e1dd;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hp=367d028568dc15ba77867151afed2a6c033036ee;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b;p=ossec-hids.git diff --git a/src/shared/tests/hash_test.c b/src/shared/tests/hash_test.c old mode 100755 new mode 100644 index 367d028..eca69b9 --- a/src/shared/tests/hash_test.c +++ b/src/shared/tests/hash_test.c @@ -1,5 +1,6 @@ #include #include + #include "hash_op.h" @@ -12,28 +13,24 @@ int main(int argc, char **argv) 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 - { + } 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 */