Tidyup to ensure '\n' is treated identically in all
authorJeremy Allison <jra@samba.org>
Thu, 1 May 2008 15:48:52 +0000 (08:48 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 1 May 2008 15:48:52 +0000 (08:48 -0700)
cases.
Jeremy.

source/client/mount.cifs.c

index d1b735525e9534826777cc3d821a88ddf1cb97b7..c42375b5743ebffbf6c981e40ecd94ab97668cba 100644 (file)
@@ -213,6 +213,7 @@ static int open_cred_file(char * file_name)
                                for(length = 0;length<4087;length++) {
                                        if ((temp_val[length] == '\n')
                                            || (temp_val[length] == '\0')) {
+                                               temp_val[length] = '\0';
                                                break;
                                        }
                                }
@@ -332,6 +333,7 @@ static int get_password_from_file(int file_descript, char * filename)
                        break;
                } else /* read valid character */ {
                        if((c == 0) || (c == '\n')) {
+                               mountpassword[i] = '\0';
                                break;
                        } else 
                                mountpassword[i] = c;