lib/util: remove extra safe_string.h file
[bbaumbach/samba-autobuild/.git] / source4 / torture / basic / mangle_test.c
index 98c53aac217b5cb26a028a52c402dc14f0ca900b..0c3ccd54bf94e02e4db3212e553e52c3c256e236 100644 (file)
 */
 
 #include "includes.h"
-#include "torture/torture.h"
 #include "system/filesys.h"
 #include "system/dir.h"
-#include "../tdb/include/tdb.h"
+#include <tdb.h>
 #include "../lib/util/util_tdb.h"
 #include "libcli/libcli.h"
 #include "torture/util.h"
+#include "torture/basic/proto.h"
+
+#undef strcasecmp
 
 static TDB_CONTEXT *tdb;
 
 #define NAME_LENGTH 20
 
-static uint_t total, collisions, failures;
+static unsigned int total, collisions, failures;
 
 static bool test_one(struct torture_context *tctx ,struct smbcli_state *cli, 
                     const char *name)
@@ -115,8 +117,8 @@ static bool test_one(struct torture_context *tctx ,struct smbcli_state *cli,
 static char *gen_name(TALLOC_CTX *mem_ctx)
 {
        const char *chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz._-$~...";
-       uint_t max_idx = strlen(chars);
-       uint_t len;
+       unsigned int max_idx = strlen(chars);
+       unsigned int len;
        int i;
        char *p;
        char *name;
@@ -145,7 +147,7 @@ static char *gen_name(TALLOC_CTX *mem_ctx)
 
        /* and a medium probability of a common lead string */
        if ((len > 5) && (random() % 10 == 0)) {
-               strncpy(p, "ABCDE", 5);
+               strlcpy(p, "ABCDE", 6);
        }
 
        /* and a high probability of a good extension length */