mirror of https://github.com/BOINC/boinc.git
client: strip whitespace when read GUI RPC passwd file
This commit is contained in:
parent
86d0e9fbd1
commit
1cca463736
|
@ -478,16 +478,10 @@ int read_gui_rpc_password(char* buf, string& msg) {
|
|||
return ERR_FOPEN;
|
||||
#endif
|
||||
}
|
||||
char* p = fgets(buf, 256, f);
|
||||
if (p) {
|
||||
// trim CR
|
||||
//
|
||||
int n = (int)strlen(buf);
|
||||
if (n && buf[n-1]=='\n') {
|
||||
buf[n-1] = 0;
|
||||
}
|
||||
buf[0] = 0;
|
||||
if (fgets(buf, 256, f)) {
|
||||
strip_whitespace(buf);
|
||||
}
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue