From 81b392b353b0d4812adc0ee8c767251a5bd738e4 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 25 Feb 2008 09:51:33 +0100 Subject: [PATCH] Fix confusing error message -- bug 5252 Thanks to Walter Franzini --- source/client/mount.cifs.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c index 3662fb5541d..4385412f988 100755 --- a/source/client/mount.cifs.c +++ b/source/client/mount.cifs.c @@ -203,8 +203,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"); @@ -227,8 +229,10 @@ 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) { printf("mount.cifs failed: password in credentials file too long\n"); @@ -256,8 +260,10 @@ 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') - break; + if ((temp_val[length] == '\n') + || (temp_val[length] == '\0')) { + break; + } } if(length > 64) { printf("mount.cifs failed: domain in credentials file too long\n"); -- 2.11.4.GIT