src/protocols/oscar/info.c

changeset 4853
5b5ed316fe65
parent 4827
77b48b018834
child 4870
50dac8774e21
--- a/src/protocols/oscar/info.c	Sat Mar 22 06:11:12 2003 +0000
+++ b/src/protocols/oscar/info.c	Sat Mar 22 07:29:34 2003 +0000
@@ -633,24 +633,20 @@
 			 * about the buddy icon that the user has stored on 
 			 * the server.
 			 */
-			int type, subtype, len;
-			char *iconstr;
+			int flags, number, len;
+			fu8_t *csum;
+
 			while (aim_bstream_curpos(bs) < endpos) {
-				type = aimbs_get16(bs);
-				subtype = aimbs_get8(bs);
-				if ((type != 0x0001) || (subtype != 0x01)) {
-					aim_bstream_advance(bs, aimbs_get8(bs));
-				} else {
-					len = aimbs_get8(bs);
-					if (len < 30) {
-						iconstr = aimbs_getraw(bs, len);
-						memcpy(outinfo->iconstr, iconstr, len);
-						outinfo->iconstrlen = len;
-						free(iconstr);
-					} else {
-						aim_bstream_advance(bs, len);
-					}
-				}
+				flags = aimbs_get16(bs);
+				number = aimbs_get8(bs);
+				len = aimbs_get8(bs);
+				if ((flags & 0x0001) && (number == 0x01) && (len < 30)) {
+					csum = aimbs_getraw(bs, len);
+					memcpy(outinfo->iconcsum, csum, len);
+					outinfo->iconcsumlen = len;
+					free(csum);
+				} else
+					aim_bstream_advance(bs, len);
 			}
 
 		} else if (type == 0x001e) {

mercurial