fix mandatory client logfile
The logfile can't be created before the commandline arguments are parsed, because before that, the home directory is unknown. This patch logs into a memory buffer which is then copied to the logfile as soon as the logfile is created after processing the commandline arguments. The memory buffer is created during the initialisation of global variables, and destroyed after the logfile is created.
This commit is contained in:
@@ -403,6 +403,14 @@ char *concatformatstring(char *d, const char *s, ...)
|
||||
return concatstring(d, temp);
|
||||
}
|
||||
|
||||
int cvecprintf(vector<char> &v, const char *s, ...)
|
||||
{
|
||||
defvformatstring(temp, s, s);
|
||||
int len = strlen(temp);
|
||||
if(len) v.put(temp, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
const char *hiddenpwd(const char *pwd, int showchars)
|
||||
{
|
||||
static int sc = 3;
|
||||
|
||||
Reference in New Issue
Block a user