Changeset 5ebff60 for protocols/oscar/search.c
- Timestamp:
- 2015-02-20T22:50:54Z (9 years ago)
- Branches:
- master
- Children:
- 0b9daac, 3d45471, 7733b8c
- Parents:
- af359b4
- git-author:
- Indent <please@…> (19-02-15 05:47:20)
- git-committer:
- dequis <dx@…> (20-02-15 22:50:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/search.c
raf359b4 r5ebff60 22 22 } 23 23 24 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 24 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) { 25 25 ret = userfunc(sess, rx, snac2->data /* address */); 26 } 26 27 27 28 /* XXX freesnac()? */ 28 if (snac2) 29 if (snac2) { 29 30 g_free(snac2->data); 31 } 30 32 g_free(snac2); 31 33 … … 42 44 char *searchaddr = NULL; 43 45 44 if ((snac2 = aim_remsnac(sess, snac->id))) 45 searchaddr = (char *)snac2->data; 46 if ((snac2 = aim_remsnac(sess, snac->id))) { 47 searchaddr = (char *) snac2->data; 48 } 46 49 47 50 tlvlist = aim_readtlvchain(bs); … … 49 52 50 53 /* XXX uhm. */ 51 while ((cur = aim_gettlv_str(tlvlist, 0x0001, j +1)) && j < m) {52 buf = g_realloc(buf, (j +1) * (MAXSNLEN+1));54 while ((cur = aim_gettlv_str(tlvlist, 0x0001, j + 1)) && j < m) { 55 buf = g_realloc(buf, (j + 1) * (MAXSNLEN + 1)); 53 56 54 strncpy(&buf[j * (MAXSNLEN +1)], cur, MAXSNLEN);57 strncpy(&buf[j * (MAXSNLEN + 1)], cur, MAXSNLEN); 55 58 g_free(cur); 56 59 57 j++; 60 j++; 58 61 } 59 62 60 63 aim_freetlvchain(&tlvlist); 61 64 62 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 65 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) { 63 66 ret = userfunc(sess, rx, searchaddr, j, buf); 67 } 64 68 65 69 /* XXX freesnac()? */ 66 if (snac2) 70 if (snac2) { 67 71 g_free(snac2->data); 72 } 68 73 g_free(snac2); 69 74 … … 76 81 { 77 82 78 if (snac->subtype == 0x0001) 83 if (snac->subtype == 0x0001) { 79 84 return error(sess, mod, rx, snac, bs); 80 else if (snac->subtype == 0x0003)85 } else if (snac->subtype == 0x0003) { 81 86 return reply(sess, mod, rx, snac, bs); 87 } 82 88 83 89 return 0;
Note: See TracChangeset
for help on using the changeset viewer.