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:
ac-stef
2014-10-06 12:43:32 +02:00
parent 8838972e83
commit 3bbe1f9555
5 changed files with 23 additions and 4 deletions
+8
View File
@@ -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;