diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-06-15 11:17:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:17:28 -0500 |
commit | 05f59b2c349d2f5a0f01b8377ba9e064d2f83e75 (patch) | |
tree | 340f72f222012694c3fca570a30ff83aa2ac2a37 /source3 | |
parent | fdced4467f6108eb848ffe79b9604134487c543c (diff) | |
download | samba-05f59b2c349d2f5a0f01b8377ba9e064d2f83e75.tar.gz samba-05f59b2c349d2f5a0f01b8377ba9e064d2f83e75.tar.xz samba-05f59b2c349d2f5a0f01b8377ba9e064d2f83e75.zip |
r16250: Fix Klokwork IDs 148, 151, 152, 154.
Volker
(This used to be commit d7a75ee94db009085165c062f73b68162a8b6da8)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/client/client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index aa25d9aba5b..c1ff1151c0e 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 == '\\') |