Introduced wrapper macros snew(), snewn() and sresize() for the
[sgt/putty] / logging.c
index 6c4e188..d526474 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -163,7 +163,7 @@ void logfclose(void *handle)
 
 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 */
@@ -258,5 +258,5 @@ static void xlatlognam(Filename *dest, Filename src,
     }
     *d = '\0';
 
-    *dest = filename_from_str(d);
+    *dest = filename_from_str(buffer);
 }