summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-07-04 16:40:10 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-07-04 16:40:10 +0200
commiteb080261f8bf216d8c913ee61106e6356ccc8ca4 (patch)
tree01f12963ad2c14c169deabd755933b3fdec35373
parent0fb8ac9e7bf746e33ca133555a37e5020106972e (diff)
downloadweechat-eb080261f8bf216d8c913ee61106e6356ccc8ca4.zip
logger: fix type of value returned by function logger_tail_last_eol
-rw-r--r--src/plugins/logger/logger-tail.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/logger/logger-tail.c b/src/plugins/logger/logger-tail.c
index 6355c1d25..6325366af 100644
--- a/src/plugins/logger/logger-tail.c
+++ b/src/plugins/logger/logger-tail.c
@@ -41,13 +41,13 @@
* Searches for last EOL in a string.
*/
-char *
+const char *
logger_tail_last_eol (const char *string_start, const char *string_ptr)
{
while (string_ptr >= string_start)
{
if ((string_ptr[0] == '\n') || (string_ptr[0] == '\r'))
- return (char *)string_ptr;
+ return string_ptr;
string_ptr--;
}
@@ -111,7 +111,7 @@ logger_tail_file (const char *filename, int n_lines)
ptr_buf = buf + bytes_read - 1;
while (ptr_buf && (ptr_buf >= buf))
{
- pos_eol = logger_tail_last_eol (buf, ptr_buf);
+ pos_eol = (char *)logger_tail_last_eol (buf, ptr_buf);
if ((pos_eol && (pos_eol[1] || part_of_line)) || (file_pos == 0))
{
/* use data and part_of_line (if existing) to build a new line */