[Telepathy-commits] [telepathy-idle/master] Fix another signedness warning.

Will Thompson will.thompson at collabora.co.uk
Wed Sep 24 02:47:08 PDT 2008


---
 src/idle-text.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/idle-text.c b/src/idle-text.c
index bd71eec..a6ae4aa 100644
--- a/src/idle-text.c
+++ b/src/idle-text.c
@@ -95,7 +95,9 @@ void idle_text_send(GObject *obj, guint type, const gchar *recipient, const gcha
 		char *br = strchr (part, '\n');
 		size_t len = IRC_MSG_MAXLEN - headerlen;
 		if (br) {
-			len = (len < br - part) ? len : br - part;
+			/* If br is non-NULL, (br - part) will always be positive. */
+			size_t len_to_br = br - part;
+			len = (len < len_to_br) ? len : len_to_br;
 		}
 
 		if (type == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION) {
-- 
1.5.6.5




More information about the Telepathy-commits mailing list