Re: [msysGit] [PATCH/RFC 03/11] mingw: implement syslog
From: Johannes Sixt <hidden>
Date: 2016-06-15 22:47:47
On Freitag, 27. November 2009, Erik Faye-Lund wrote:
On Thu, Nov 26, 2009 at 10:23 PM, Johannes Sixt [off-list ref] wrote:quoted
I would const char* arg; if (strcmp(fmt, "%s")) die("format string of syslog() not implemented") va_start(va, fmt); arg = va_arg(va, char*); va_end(va); because we have exactly one invocation of syslog(), which passes "%s" as format string. Then strbuf_vaddf is not needed. Or even simpler: declare the function as void syslog(int priority, const char *fmt, const char*arg);After reading this again, I agree that this is the best solution. I'll update for the next iteration.
Except that you shouldn't die like I proposed because here we are already in the die_routine, no?
quoted
"Note that the string that you log cannot contain %n, where n is an integer value (for example, %1) because the event viewer treats it as an insertion string. ..." How are the chances that this condition applies to our use of the function?Ugh, increasingly high since we're adding IPv6 support, I guess. Perhaps some form of escaping needs to be done?
I think so, but actually I have no clue. -- Hannes