Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/presence.c @ 17564:ac1ee71efd89
Small fix for caps
author | Andreas Monitzer <pidgin@monitzer.com> |
---|---|
date | Wed, 06 Jun 2007 01:23:18 +0000 |
parents | 95affacf6f82 |
children | 0370da969e8a |
comparison
equal
deleted
inserted
replaced
17563:95affacf6f82 | 17564:ac1ee71efd89 |
---|---|
180 | 180 |
181 if(js != NULL) { | 181 if(js != NULL) { |
182 /* add the extensions */ | 182 /* add the extensions */ |
183 char extlist[1024]; | 183 char extlist[1024]; |
184 unsigned remaining = 1023; /* one less for the \0 */ | 184 unsigned remaining = 1023; /* one less for the \0 */ |
185 GSList *feature; | 185 GList *feature; |
186 | 186 |
187 extlist[0] = '\0'; | 187 extlist[0] = '\0'; |
188 for(feature = js->features; feature && remaining > 0; feature = feature->next) { | 188 for(feature = js->features; feature && remaining > 0; feature = feature->next) { |
189 JabberFeature *feat = (JabberFeature*)feature->data; | 189 JabberFeature *feat = (JabberFeature*)feature->data; |
190 unsigned featlen = strlen(feat->shortname); | 190 unsigned featlen = strlen(feat->shortname); |
193 if(featlen > remaining) | 193 if(featlen > remaining) |
194 break; | 194 break; |
195 | 195 |
196 strncat(extlist,feat->shortname,remaining); | 196 strncat(extlist,feat->shortname,remaining); |
197 remaining -= featlen; | 197 remaining -= featlen; |
198 strncat(extlist," ",remaining); | 198 if(feature->next) { /* no space at the end */ |
199 --remaining; | 199 strncat(extlist," ",remaining); |
200 --remaining; | |
201 } | |
200 } | 202 } |
201 /* did we add anything? */ | 203 /* did we add anything? */ |
202 if(remaining < 1023) | 204 if(remaining < 1023) |
203 xmlnode_set_attrib(c, "ext", extlist); | 205 xmlnode_set_attrib(c, "ext", extlist); |
204 } | 206 } |