novi upstream verzije 2.8.3
[ossec-hids.git] / src / shared / tests / string_test.c
diff --git a/src/shared/tests/string_test.c b/src/shared/tests/string_test.c
new file mode 100755 (executable)
index 0000000..aadd3e4
--- /dev/null
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <string.h>
+#include "string_op.h"
+
+
+int main(int argc, char **argv)
+{
+    int i = 0;
+    char *tmp;
+    char buf[] = "/var/www/html/Testing This Interface$%^&*().txt";
+    tmp = os_shell_escape(buf);
+    char clean[] = "/var/www/html/index.html";
+
+    printf("Sent: '%s'\n", buf);
+    printf("Fixed: '%s'\n", tmp);
+    free(tmp);
+
+    tmp = os_shell_escape(clean);
+    printf("Sent: '%s'\n", clean);
+    printf("Fixed: '%s'\n", tmp);
+
+
+    return(0);
+}
+
+
+/* EOF */