Fix ICS channel 0
authorH.G. Muller <h.g.muller@hccnet.nl>
Wed, 16 Feb 2011 11:03:22 +0000 (12:03 +0100)
committerArun Persaud <apersaud@lbl.gov>
Thu, 17 Feb 2011 03:08:30 +0000 (19:08 -0800)
Channel 0 messages were not displayed in the console, because the test
for channel number considered every non-numeric or non-existent handle
in a chatbox to be zero. So the messages were diverted to a non-exsting
chatbox. Now it test first for the handle to start with a digit.

backend.c

index d281a92..460a4af 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -2861,7 +2861,7 @@ read_from_ics(isr, closure, data, count, error)
 
                if(channel >= 0) // channel broadcast; look if there is a chatbox for this channel
                for(p=0; p<MAX_CHAT; p++) {
-                   if(channel == atoi(chatPartner[p])) {
+                   if(chatPartner[p][0] >= '0' && chatPartner[p][0] <= '9' && channel == atoi(chatPartner[p])) {
                    talker[0] = '['; strcat(talker, "] ");
                    Colorize(channel == 1 ? ColorChannel1 : ColorChannel, FALSE);
                    chattingPartner = p; break;