summaryrefslogtreecommitdiff
path: root/test/recovery/truncated-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/recovery/truncated-log.c')
-rw-r--r--test/recovery/truncated-log.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/test/recovery/truncated-log.c b/test/recovery/truncated-log.c
index c265263d44c..a127d8c1c63 100644
--- a/test/recovery/truncated-log.c
+++ b/test/recovery/truncated-log.c
@@ -30,13 +30,7 @@
#include <sys/wait.h>
-#ifdef _WIN32
-/* snprintf is not supported on <= VS2013 */
-#define snprintf _snprintf
-#endif
-
-static char home[512]; /* Program working dir */
-static const char *progname; /* Program name */
+static char home[1024]; /* Program working dir */
static const char * const uri = "table:main";
#define RECORDS_FILE "records"
@@ -138,7 +132,8 @@ usage(void)
* Child process creates the database and table, and then writes data into
* the table until it is killed by the parent.
*/
-static void fill_db(void)WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn));
+static void fill_db(void)
+ WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn));
static void
fill_db(void)
{
@@ -194,9 +189,9 @@ fill_db(void)
max_key = min_key * 2;
first = true;
for (i = 0; i < max_key; ++i) {
- snprintf(k, sizeof(k), "key%03d", (int)i);
- snprintf(v, sizeof(v), "value%0*d",
- (int)(V_SIZE - strlen("value")), (int)i);
+ testutil_check(__wt_snprintf(k, sizeof(k), "key%03d", (int)i));
+ testutil_check(__wt_snprintf(v, sizeof(v), "value%0*d",
+ (int)(V_SIZE - (strlen("value") + 1)), (int)i));
cursor->set_key(cursor, k);
cursor->set_value(cursor, v);
if ((ret = cursor->insert(cursor)) != 0)
@@ -271,10 +266,7 @@ main(int argc, char *argv[])
pid_t pid;
const char *working_dir;
- if ((progname = strrchr(argv[0], DIR_DELIM)) == NULL)
- progname = argv[0];
- else
- ++progname;
+ (void)testutil_set_progname(argv);
working_dir = "WT_TEST.truncated-log";
while ((ch = __wt_getopt(progname, argc, argv, "h:")) != EOF)
@@ -290,7 +282,7 @@ main(int argc, char *argv[])
if (argc != 0)
usage();
- testutil_work_dir_from_path(home, 512, working_dir);
+ testutil_work_dir_from_path(home, sizeof(home), working_dir);
testutil_make_work_dir(home);
/*