summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-02-25 09:51:33 +0100
committerVolker Lendecke <vl@samba.org>2008-02-25 09:51:33 +0100
commit19de47fef1b35c47885acc40760a232e4643079c (patch)
tree6ab83e45f5ab5aa2e3c8dd01161256a2842beff8
parent8f86f7f25c4eb71bbdfcc6bf2d12eaaae9a8d9ec (diff)
downloadsamba-19de47fef1b35c47885acc40760a232e4643079c.tar.gz
Fix confusing error message -- bug 5252
Thanks to Walter Franzini
-rw-r--r--source/client/mount.cifs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index 44614f6e8a3..c68c9ee7f76 100644
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -205,8 +205,10 @@ static int open_cred_file(char * file_name)
/* go past equals sign */
temp_val++;
for(length = 0;length<4087;length++) {
- if(temp_val[length] == '\n')
+ if ((temp_val[length] == '\n')
+ || (temp_val[length] == '\0')) {
break;
+ }
}
if(length > 4086) {
printf("mount.cifs failed due to malformed username in credentials file");
@@ -229,7 +231,7 @@ static int open_cred_file(char * file_name)
/* go past equals sign */
temp_val++;
for(length = 0;length<65;length++) {
- if(temp_val[length] == '\n')
+ if(temp_val[length] == '\n' || temp_val[length] == '\0')
break;
}
if(length > 64) {
@@ -258,7 +260,7 @@ static int open_cred_file(char * file_name)
if(verboseflag)
printf("\nDomain %s\n",temp_val);
for(length = 0;length<65;length++) {
- if(temp_val[length] == '\n')
+ if(temp_val[length] == '\n' || temp_val[length] == '\0')
break;
}
if(length > 64) {