* platforms. Platforms which don't have a meaningful stderr can
* just avoid defining FLAG_STDERR.
*/
-void log_eventlog(void *handle, char *event)
+void log_eventlog(void *handle, const char *event)
{
struct LogContext *ctx = (struct LogContext *)handle;
if ((flags & FLAG_STDERR) && (flags & FLAG_VERBOSE)) {
ctx->cfg.logtype == LGTYP_DEBUG ? "raw" :
ctx->cfg.logtype == LGTYP_PACKETS ? "SSH packets" : "<ukwn>"));
/* Make sure we do not exceed the output buffer size */
- strncat(buf, filename_to_str(ctx->currlogfilename), 128);
+ strncat(buf, filename_to_str(&ctx->currlogfilename), 128);
buf[strlen(buf)] = '\0';
logevent(ctx->frontend, buf);
}
void *log_init(void *frontend, Config *cfg)
{
- struct LogContext *ctx = smalloc(sizeof(struct LogContext));
+ struct LogContext *ctx = snew(struct LogContext);
ctx->lgfp = NULL;
ctx->frontend = frontend;
ctx->cfg = *cfg; /* STRUCTURE COPY */
int size;
char buffer[FILENAME_MAX];
int len = sizeof(buffer)-1;
- char *d, *s;
+ char *d;
+ const char *s;
d = buffer;
- s = filename_to_str(src);
+ s = filename_to_str(&src);
while (*s) {
/* Let (bufp, len) be the string to append. */
}
*d = '\0';
- *dest = filename_from_str(s);
+ *dest = filename_from_str(buffer);
}