Mercurial > pidgin.yaz
changeset 13126:a36053525b79
[gaim-migrate @ 15488]
I believe this is equivalent. And it should be more portable.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 05 Feb 2006 22:23:45 +0000 |
parents | 442b23efba54 |
children | 752487ec185c |
files | src/dnssrv.c |
diffstat | 1 files changed, 14 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dnssrv.c Sun Feb 05 21:30:43 2006 +0000 +++ b/src/dnssrv.c Sun Feb 05 22:23:45 2006 +0000 @@ -95,7 +95,7 @@ guchar *end; guchar *cp; gchar name[256]; - int type, dlen, pref, weight, port; + guint16 type, dlen, pref, weight, port; gchar query[256]; if(read(in, query, 256) <= 0) { @@ -124,17 +124,24 @@ cp += size; - NS_GET16(type,cp); - cp += 6; /* skip ttl and class since we already know it */ + type = GUINT16_FROM_BE(*cp); + cp += 2; - NS_GET16(dlen,cp); + /* skip ttl and class since we already know it */ + cp += 6; + + dlen = GUINT16_FROM_BE(*cp); + cp += 2; if (type == T_SRV) { - NS_GET16(pref,cp); + pref = GUINT16_FROM_BE(*cp); + cp += 2; - NS_GET16(weight, cp); + weight = GUINT16_FROM_BE(*cp); + cp += 2; - NS_GET16(port, cp); + port = GUINT16_FROM_BE(*cp); + cp += 2; size = dn_expand( (unsigned char*)&answer, end, cp, name, 256); if(size < 0 )