--- a/libpurple/plugins/log_reader.c Wed Jul 20 16:51:55 2011 +0000
+++ b/libpurple/plugins/log_reader.c Thu Jul 21 05:36:54 2011 +0000
@@ -1454,11 +1454,10 @@
const char *footer = NULL;
- if ((c = strstr(c, "\n")))
+ /* The data is always terminated with a newline (see above) */ @@ -1482,14 +1481,14 @@
- if (!(end_paren = strstr(link, ")")))
+ if (!(end_paren = strchr(link, ')'))) /* Something is not as we expect. Bail out. */
- temp = g_string_sized_new(c ? (c - 1 - line) : strlen(line));
+ temp = g_string_sized_new(strlen(line)); g_string_append_len(temp, line, (tmp - line));
@@ -1504,7 +1503,7 @@
/* The \r is a bit of a hack to keep there from being a \r in
* the link text, which may not matter. */
- if ((space = strstr(end_paren, " ")) || (space = strstr(end_paren, "\r")))
+ if ((space = strchr(end_paren, ' ')) || (space = strchr(end_paren, '\r'))) g_string_append_len(temp, end_paren + 1, space - end_paren - 1);
@@ -1539,7 +1538,7 @@
- if ((timestamp = strstr(line, "]"))) {
+ if ((timestamp = strchr(line, ']'))) { /* TODO: Parse the timestamp and convert it to Purple's format. */
g_string_append(formatted, "<font size=\"2\">(");
@@ -1658,7 +1657,7 @@
- const char *line2 = strstr(line, ":");
+ const char *line2 = strchr(line, ':'); @@ -1828,11 +1827,11 @@
/* Find the last '(' character. */
- if ((tmp = strstr(c, "\n")) != NULL) {
+ if ((tmp = strchr(c, '\n')) != NULL) { while (*tmp && *tmp != '(') --tmp;
@@ -1904,7 +1903,7 @@
@@ -1983,13 +1982,13 @@
is_in_message = purple_str_has_prefix(line, QIP_LOG_IN_MESSAGE_ESC);
/* XXX: Do we need buddy_name when we have buddy->alias? */
/* Find the last '(' character. */
- if ((tmp = strstr(c, "\n")) != NULL) {
+ if ((tmp = strchr(c, '\n')) != NULL) { while (*tmp && *tmp != '(') --tmp;
@@ -2042,12 +2041,12 @@
- if ((c = strstr(c, "\n")))
+ if ((c = strchr(c, '\n'))) if (line[0] != '\n' && line[0] != '\r') {
@@ -2186,7 +2185,7 @@
sn, data->path, data->offset, data->length);
@@ -2342,7 +2341,7 @@
- end = strstr(start, "\n");
+ end = strchr(start, '\n');