Mercurial > pidgin.yaz
comparison libfaim/aim_tlv.c @ 818:f425f51a3db8
[gaim-migrate @ 828]
libfaim
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 01 Sep 2000 00:21:36 +0000 |
parents | 72e556f6b99d |
children | 595ac7759563 |
comparison
equal
deleted
inserted
replaced
817:aefd5f2b1ea0 | 818:f425f51a3db8 |
---|---|
43 cur = (struct aim_tlvlist_t *)malloc(sizeof(struct aim_tlvlist_t)); | 43 cur = (struct aim_tlvlist_t *)malloc(sizeof(struct aim_tlvlist_t)); |
44 memset(cur, 0x00, sizeof(struct aim_tlvlist_t)); | 44 memset(cur, 0x00, sizeof(struct aim_tlvlist_t)); |
45 | 45 |
46 cur->tlv = aim_createtlv(); | 46 cur->tlv = aim_createtlv(); |
47 cur->tlv->type = type; | 47 cur->tlv->type = type; |
48 cur->tlv->length = length; | 48 cur->tlv->length = length; |
49 cur->tlv->value = (u_char *)malloc(length*sizeof(u_char)); | 49 if (length) { |
50 memcpy(cur->tlv->value, buf+pos, length); | 50 cur->tlv->value = (unsigned char *)malloc(length); |
51 memcpy(cur->tlv->value, buf+pos, length); | |
52 } | |
51 | 53 |
52 cur->next = list; | 54 cur->next = list; |
53 list = cur; | 55 list = cur; |
54 } | 56 } |
55 pos += length; | 57 pos += length; |