summaryrefslogtreecommitdiff
path: root/src/support/filename.c
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@wiredtiger.com>2012-01-12 19:19:55 +0000
committerKeith Bostic <keith.bostic@wiredtiger.com>2012-01-12 19:19:55 +0000
commit5d94c01052c70c43e89d81f71d86531a0911f287 (patch)
treef55eaa1de9cd6c212b6a48efb524814de809a321 /src/support/filename.c
parentd9fccdb311e41f38ecb4bb4ac2a03963965a3055 (diff)
downloadmongo-5d94c01052c70c43e89d81f71d86531a0911f287.tar.gz
__wt_filename doesn't need to know about WT_BUF structures, or stealing
them, call calloc directly and be done with it.
Diffstat (limited to 'src/support/filename.c')
-rw-r--r--src/support/filename.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/support/filename.c b/src/support/filename.c
index 0a40101c9be..4e4a6cd72e8 100644
--- a/src/support/filename.c
+++ b/src/support/filename.c
@@ -14,13 +14,17 @@
int
__wt_filename(WT_SESSION_IMPL *session, const char *name, const char **path)
{
- WT_BUF tmp;
WT_CONNECTION_IMPL *conn;
+ size_t len;
+ char *buf;
conn = S2C(session);
+ *path = NULL;
- WT_CLEAR(tmp);
- WT_RET(__wt_buf_fmt(session, &tmp, "%s/%s", conn->home, name));
- *path = __wt_buf_steal(session, &tmp, NULL);
+ len = strlen(conn->home) + 1 + strlen(name) + 1;
+ WT_RET(__wt_calloc(session, 1, len, &buf));
+ snprintf(buf, len, "%s/%s", conn->home, name);
+
+ *path = buf;
return (0);
}