From de7fd585b11413113304334dd75ba6a207ec69eb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 4 Dec 2007 16:56:18 -0800 Subject: The usual !pstring... Jeremy. (This used to be commit b676262a781363e7be49b21817668a53cca75c2d) --- source3/torture/locktest2.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source3/torture/locktest2.c') diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c index bdf9e51970..45a957e3a4 100644 --- a/source3/torture/locktest2.c +++ b/source3/torture/locktest2.c @@ -64,16 +64,21 @@ static struct record *recorded; static int try_open(struct cli_state *c, char *nfs, int fstype, const char *fname, int flags) { - pstring path; + char *path; switch (fstype) { case FSTYPE_SMB: return cli_open(c, fname, flags, DENY_NONE); case FSTYPE_NFS: - slprintf(path, sizeof(path), "%s%s", nfs, fname); - pstring_sub(path,"\\", "/"); - return open(path, flags, 0666); + if (asprintf(&path, "%s%s", nfs, fname) > 0) { + int ret; + string_replace(path,'\\', '/'); + ret = open(path, flags, 0666); + SAFE_FREE(path); + return ret; + } + break; } return -1; -- cgit