From 27d80498d30d8de84fff82fab363b0bc1ad5c116 Mon Sep 17 00:00:00 2001 From: "Sean B. Palmer" Date: Tue, 15 Nov 2011 13:56:43 +0000 Subject: [PATCH] Fix to line length limit code. --- irc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/irc.py b/irc.py index e6008e0..767aa27 100755 --- a/irc.py +++ b/irc.py @@ -49,8 +49,9 @@ class Bot(asynchat.async_chat): # print '%r %r %r' % (self, args, text) try: if text is not None: - self.push((' '.join(args) + ' :' + text)[:512] + '\r\n') - else: self.push(' '.join(args)[:512] + '\r\n') + # 510 because CR and LF count too, as nyuszika7h points out + self.push((' '.join(args) + ' :' + text)[:510] + '\r\n') + else: self.push(' '.join(args)[:510] + '\r\n') except IndexError: pass