From 27595ac18f2c19e4cbfabb4fe2638e72366fd6cb Mon Sep 17 00:00:00 2001 From: "powwow@askgustav.com" Date: Sat, 23 May 2020 11:29:22 +0200 Subject: minor beautifications 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); -- cgit v0.10.2