From 05f59b2c349d2f5a0f01b8377ba9e064d2f83e75 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 15 Jun 2006 11:17:57 +0000 Subject: r16250: Fix Klokwork IDs 148, 151, 152, 154. Volker (This used to be commit d7a75ee94db009085165c062f73b68162a8b6da8) --- source3/client/client.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/client/client.c') diff --git a/source3/client/client.c b/source3/client/client.c index aa25d9aba5..c1ff1151c0 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -269,7 +269,7 @@ static int do_cd(char *newdir) else pstrcat(cur_dir,p); - if (*(cur_dir+strlen(cur_dir)-1) != '\\') { + if ((cur_dir[0] != '\0') && (*(cur_dir+strlen(cur_dir)-1) != '\\')) { pstrcat(cur_dir, "\\"); } @@ -647,7 +647,7 @@ static int cmd_dir(void) dir_total = 0; if (strcmp(cur_dir, "\\") != 0) { pstrcpy(mask,cur_dir); - if(mask[strlen(mask)-1]!='\\') + if ((mask[0] != '\0') && (mask[strlen(mask)-1]!='\\')) pstrcat(mask,"\\"); } else { pstrcpy(mask, "\\"); @@ -686,7 +686,7 @@ static int cmd_du(void) dir_total = 0; pstrcpy(mask,cur_dir); - if(mask[strlen(mask)-1]!='\\') + if ((mask[0] != '\0') && (mask[strlen(mask)-1]!='\\')) pstrcat(mask,"\\"); if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { @@ -1008,7 +1008,7 @@ static int cmd_mget(void) while (next_token_nr(NULL,p,NULL,sizeof(buf))) { pstrcpy(mget_mask,cur_dir); - if(mget_mask[strlen(mget_mask)-1]!='\\') + if ((mask[0] != '\0') && (mget_mask[strlen(mget_mask)-1]!='\\')) pstrcat(mget_mask,"\\"); if (*p == '\\') -- cgit