From e70eae2b4c987eb413f085c7b3250a152769670e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 25 Mar 2006 16:23:42 +0000 Subject: r14721: Fix a couple of warnings. (This used to be commit 426ac78108b35adc8412d12d2d888c3d5ddf4171) --- source4/client/client.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source4/client') diff --git a/source4/client/client.c b/source4/client/client.c index 80b3f00e58..6a2ba6e98e 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -2966,19 +2966,24 @@ static int process_stdin(struct smbclient_context *ctx) return a connection to a server *******************************************************/ static struct smbclient_context *do_connect(TALLOC_CTX *mem_ctx, - const char *server, const char *share, struct cli_credentials *cred) + const char *specified_server, const char *specified_share, struct cli_credentials *cred) { NTSTATUS status; struct smbclient_context *ctx = talloc_zero(mem_ctx, struct smbclient_context); + char *server, *share; + if (!ctx) { return NULL; } rl_ctx = ctx; /* Ugly hack */ - if (strncmp(share, "\\\\", 2) == 0 || - strncmp(share, "//", 2) == 0) { - smbcli_parse_unc(share, ctx, &server, &share); + if (strncmp(specified_share, "\\\\", 2) == 0 || + strncmp(specified_share, "//", 2) == 0) { + smbcli_parse_unc(specified_share, ctx, &server, &share); + } else { + share = talloc_strdup(ctx, specified_share); + server = talloc_strdup(ctx, specified_server); } ctx->remote_cur_dir = talloc_strdup(ctx, "\\"); -- cgit