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;
|
return ERR_FOPEN;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
char* p = fgets(buf, 256, f);
|
buf[0] = 0;
|
||||||
if (p) {
|
if (fgets(buf, 256, f)) {
|
||||||
// trim CR
|
strip_whitespace(buf);
|
||||||
//
|
|
||||||
int n = (int)strlen(buf);
|
|
||||||
if (n && buf[n-1]=='\n') {
|
|
||||||
buf[n-1] = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue