aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/s5bytestream.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-03-18 00:07:16 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-03-18 00:07:16 +0000
commit78d254f110d47f9e0c3a8f12259f93a4faa2130d (patch)
treecd48282657f1e7f3d66032d25f5c8e37159dfe2c /protocols/jabber/s5bytestream.c
parent42fc5b6cfed51ac011df8877cf5e24f00828e8be (diff)
More small fixes. (NULL derefs and s/close/disconnect/)
Diffstat (limited to 'protocols/jabber/s5bytestream.c')
-rw-r--r--protocols/jabber/s5bytestream.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/jabber/s5bytestream.c b/protocols/jabber/s5bytestream.c
index c292e61e..5fcbef6a 100644
--- a/protocols/jabber/s5bytestream.c
+++ b/protocols/jabber/s5bytestream.c
@@ -281,11 +281,12 @@ int jabber_bs_recv_request( struct im_connection *ic, struct xt_node *node, stru
shnode = qnode->children;
while( ( shnode = xt_find_node( shnode, "streamhost" ) ) )
{
- char *jid, *host;
+ char *jid, *host, *port_s;
int port;
if( ( jid = xt_find_attr( shnode, "jid" ) ) &&
( host = xt_find_attr( shnode, "host" ) ) &&
- ( ( port = atoi( xt_find_attr( shnode, "port" ) ) ) ) )
+ ( port_s = xt_find_attr( shnode, "port" ) ) &&
+ ( sscanf( port_s, "%d", &port ) == 1 ) )
{
jabber_streamhost_t *sh = g_new0( jabber_streamhost_t, 1 );
sh->jid = g_strdup(jid);