Mercurial > pidgin
comparison src/dnssrv.c @ 11381:e0f42900de12
[gaim-migrate @ 13608]
Remove some warnings
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 31 Aug 2005 04:09:04 +0000 |
parents | 51c189755f1d |
children | bdeace860555 |
comparison
equal
deleted
inserted
replaced
11380:eb49e64d02fd | 11381:e0f42900de12 |
---|---|
85 struct srv_response *srvres; | 85 struct srv_response *srvres; |
86 queryans answer; | 86 queryans answer; |
87 int size; | 87 int size; |
88 int qdcount; | 88 int qdcount; |
89 int ancount; | 89 int ancount; |
90 gchar *end; | 90 guchar *end; |
91 gchar *cp; | 91 guchar *cp; |
92 gchar name[256]; | 92 gchar name[256]; |
93 int type, dlen, pref, weight, port; | 93 int type, dlen, pref, weight, port; |
94 gchar query[256]; | 94 gchar query[256]; |
95 | 95 |
96 if(read(in, query, 256) <= 0) { | 96 if(read(in, query, 256) <= 0) { |
100 | 100 |
101 qdcount = ntohs(answer.hdr.qdcount); | 101 qdcount = ntohs(answer.hdr.qdcount); |
102 ancount = ntohs(answer.hdr.ancount); | 102 ancount = ntohs(answer.hdr.ancount); |
103 | 103 |
104 | 104 |
105 cp = (char*)&answer + sizeof(HEADER); | 105 cp = (guchar*)&answer + sizeof(HEADER); |
106 end = (char*)&answer + size; | 106 end = (guchar*)&answer + size; |
107 | 107 |
108 /* skip over unwanted stuff */ | 108 /* skip over unwanted stuff */ |
109 while (qdcount-- > 0 && cp < end) { | 109 while (qdcount-- > 0 && cp < end) { |
110 size = dn_expand( (char*)&answer, end, cp, name, 256); | 110 size = dn_expand( (unsigned char*)&answer, end, cp, name, 256); |
111 if(size < 0) goto end; | 111 if(size < 0) goto end; |
112 cp += size + QFIXEDSZ; | 112 cp += size + QFIXEDSZ; |
113 } | 113 } |
114 | 114 |
115 while (ancount-- > 0 && cp < end) { | 115 while (ancount-- > 0 && cp < end) { |
116 size = dn_expand((char*)&answer, end, cp, name, 256); | 116 size = dn_expand((unsigned char*)&answer, end, cp, name, 256); |
117 if(size < 0) | 117 if(size < 0) |
118 goto end; | 118 goto end; |
119 | 119 |
120 cp += size; | 120 cp += size; |
121 | 121 |
129 | 129 |
130 NS_GET16(weight, cp); | 130 NS_GET16(weight, cp); |
131 | 131 |
132 NS_GET16(port, cp); | 132 NS_GET16(port, cp); |
133 | 133 |
134 size = dn_expand( (char*)&answer, end, cp, name, 256); | 134 size = dn_expand( (unsigned char*)&answer, end, cp, name, 256); |
135 if(size < 0 ) | 135 if(size < 0 ) |
136 goto end; | 136 goto end; |
137 | 137 |
138 cp += size; | 138 cp += size; |
139 | 139 |