+/*
+ * Session logging.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
if (mode == 0) {
ctx->state = L_ERROR; /* disable logging */
} else {
- fmode = (mode == 1 ? "a" : "w");
+ fmode = (mode == 1 ? "ab" : "wb");
ctx->lgfp = f_open(ctx->currlogfilename, fmode);
if (ctx->lgfp)
ctx->state = L_OPEN;