chiark
/
gitweb
/
~ian
/
secnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
site: When if our MSG5s (or peer's MSG6s) get lost, preserve the key
[secnet.git]
/
log.c
diff --git
a/log.c
b/log.c
index 4f1b651d13735af9d899ff9988979fd87209fdb5..d940df530e914c2ffba4b0e6f3c5ad0ffd890668 100644
(file)
--- a/
log.c
+++ b/
log.c
@@
-38,6
+38,8
@@
static void vMessage(uint32_t class, const char *message, va_list args)
bp=strlen(buff);
assert(bp < MESSAGE_BUFLEN);
vsnprintf(buff+bp,MESSAGE_BUFLEN-bp,message,args);
bp=strlen(buff);
assert(bp < MESSAGE_BUFLEN);
vsnprintf(buff+bp,MESSAGE_BUFLEN-bp,message,args);
+ buff[sizeof(buff)-2] = '\n';
+ buff[sizeof(buff)-1] = '\0';
/* Each line is sent separately */
while ((nlp=strchr(buff,'\n'))) {
*nlp=0;
/* Each line is sent separately */
while ((nlp=strchr(buff,'\n'))) {
*nlp=0;
@@
-168,11
+170,11
@@
void cfgfile_postreadcheck(struct cloc loc, FILE *f)
{
assert(loc.file);
if (ferror(f)) {
{
assert(loc.file);
if (ferror(f)) {
- Message(M_FATAL, "error reading config file (%s): %s",
+ Message(M_FATAL, "error reading config file (%s): %s
\n
",
loc.file, strerror(errno));
exit(current_phase);
} else if (feof(f)) {
loc.file, strerror(errno));
exit(current_phase);
} else if (feof(f)) {
- Message(M_FATAL, "unexpected end of config file (%s)", loc.file);
+ Message(M_FATAL, "unexpected end of config file (%s)
\n
", loc.file);
exit(current_phase);
}
}
exit(current_phase);
}
}