Module Name: src
Committed By: joerg
Date: Thu Jul 24 22:59:01 UTC 2014
Modified Files:
src/external/bsd/tmux/dist: log.c
Log Message:
Avoid playing games with format strings, just use a second printf.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/tmux/dist/log.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/tmux/dist/log.c
diff -u src/external/bsd/tmux/dist/log.c:1.7 src/external/bsd/tmux/dist/log.c:1.8
--- src/external/bsd/tmux/dist/log.c:1.7 Thu Jul 24 15:09:24 2014
+++ src/external/bsd/tmux/dist/log.c Thu Jul 24 22:59:01 2014
@@ -73,17 +73,14 @@ log_close(void)
void
log_vwrite(const char *msg, va_list ap)
{
- char *fmt;
-
if (log_file == NULL)
return;
- if (asprintf(&fmt, "%s\n", msg) == -1)
+ if (vfprintf(log_file, msg, ap) == -1)
exit(1);
- if (vfprintf(log_file, fmt, ap) == -1)
+ if (fprintf(log_file, "\n") == -1)
exit(1);
fflush(log_file);
- free(fmt);
}
/* Log a warning with error string. */