mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
fix a windows bug; from nick mathewson
svn:r146
This commit is contained in:
parent
d47798be5a
commit
6ba5e0d03e
13
log.c
13
log.c
@ -87,6 +87,17 @@ event_vsnprintf(char *str, size_t size, const char *format, va_list args)
|
||||
return r;
|
||||
}
|
||||
|
||||
static int
|
||||
event_snprintf(char *str, size_t size, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int r;
|
||||
va_start(ap, format);
|
||||
r = event_vsnprintf(str, size, format, ap);
|
||||
va_end(ap);
|
||||
return r;
|
||||
}
|
||||
|
||||
void
|
||||
event_err(int eval, const char *fmt, ...)
|
||||
{
|
||||
@ -163,7 +174,7 @@ _warn_helper(int severity, int log_errno, const char *fmt, va_list ap)
|
||||
if (log_errno >= 0) {
|
||||
len = strlen(buf);
|
||||
if (len < sizeof(buf) - 3) {
|
||||
snprintf(buf + len, sizeof(buf) - len, ": %s",
|
||||
event_snprintf(buf + len, sizeof(buf) - len, ": %s",
|
||||
strerror(log_errno));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user