aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/log.c7
-rw-r--r--src/log.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/log.c b/src/log.c
index 32237b8..d4f427e 100644
--- a/src/log.c
+++ b/src/log.c
@@ -159,7 +159,7 @@ void log_resize(int newsize)
/*
* add a single line to the buffer
*/
-static void log_writeline(char *line, int len, int kind, long msecs)
+static void log_writeline(const char *line, int len, int kind, long msecs)
{
int dst;
@@ -193,7 +193,7 @@ static void log_writeline(char *line, int len, int kind, long msecs)
/*
* write to #capture / #movie buffer
*/
-void log_write(char *str, int len, int newline)
+void log_write(const char *str, int len, int newline)
{
char *next;
long diff;
@@ -228,8 +228,7 @@ void log_write(char *str, int len, int newline)
if (capturefile) {
fwrite(str, 1, i, capturefile);
if (newline) {
- const char nl[1] = "\n";
- fwrite(nl, 1, 1, capturefile);
+ fputc('\n', capturefile);
newline = 0;
}
}
diff --git a/src/log.h b/src/log.h
index a5822b4..e80357c 100644
--- a/src/log.h
+++ b/src/log.h
@@ -12,7 +12,7 @@ void log_clearsleep(void);
void log_flush(void);
int log_getsize(void);
void log_resize(int newsize);
-void log_write(char *str, int len, int newline);
+void log_write(const char *str, int len, int newline);
void reprint_writeline(char *line);
char *reprint_getline(void);