projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert sizeof foo to sizeof(foo).
[tinc]
/
src
/
logger.c
diff --git
a/src/logger.c
b/src/logger.c
index
6765cc5
..
77c8133
100644
(file)
--- a/
src/logger.c
+++ b/
src/logger.c
@@
-1,6
+1,6
@@
/*
logger.c -- logging code
/*
logger.c -- logging code
- Copyright (C) 2004-20
0
6 Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2004-20
1
6 Guus Sliepen <guus@tinc-vpn.org>
2004-2005 Ivo Timmermans
This program is free software; you can redistribute it and/or modify
2004-2005 Ivo Timmermans
This program is free software; you can redistribute it and/or modify
@@
-97,7
+97,7
@@
void logger(int priority, const char *format, ...) {
break;
case LOGMODE_FILE:
now = time(NULL);
break;
case LOGMODE_FILE:
now = time(NULL);
- strftime(timestr, sizeof
timestr
, "%Y-%m-%d %H:%M:%S", localtime(&now));
+ strftime(timestr, sizeof
(timestr)
, "%Y-%m-%d %H:%M:%S", localtime(&now));
fprintf(logfile, "%s %s[%ld]: ", timestr, logident, (long)logpid);
vfprintf(logfile, format, ap);
fprintf(logfile, "\n");
fprintf(logfile, "%s %s[%ld]: ", timestr, logident, (long)logpid);
vfprintf(logfile, format, ap);
fprintf(logfile, "\n");
@@
-109,6
+109,7
@@
void logger(int priority, const char *format, ...) {
char message[4096];
const char *messages[] = {message};
vsnprintf(message, sizeof(message), format, ap);
char message[4096];
const char *messages[] = {message};
vsnprintf(message, sizeof(message), format, ap);
+ message[sizeof(message) - 1] = 0;
ReportEvent(loghandle, priority, 0, 0, NULL, 1, 0, messages, NULL);
}
#else
ReportEvent(loghandle, priority, 0, 0, NULL, 1, 0, messages, NULL);
}
#else