Files
macports-ports/comms/telepathy-idle/files/patch-src-idle-parser.c.diff

28 lines
712 B
Diff

--- src/idle-parser.c.orig 2012-11-16 00:49:32.000000000 -0800
+++ src/idle-parser.c 2012-11-16 13:42:55.000000000 -0800
@@ -230,14 +230,22 @@
IdleParserPrivate *priv = IDLE_PARSER_GET_PRIVATE(parser);
guint i;
guint lasti = 0;
- gchar *tmp;
+ gchar *tmp, *s;
gboolean line_ends = FALSE;
guint len;
gchar concat_buf[2 * (IRC_MSG_MAXLEN + 3)] = {'\0'};
g_assert(msg != NULL);
- len = strnlen(msg, IRC_MSG_MAXLEN + 3);
+// len = strnlen(msg, IRC_MSG_MAXLEN + 3);
+
+ s = msg;
+ len = 0;
+
+ while (*s != '\0' && len < IRC_MSG_MAXLEN + 3) {
+ s++;
+ len++;
+ }
for (i = 0; i < len; i++) {
if ((msg[i] == '\n' || msg[i] == '\r')) {