Mercurial > pidgin
diff src/protocols/oscar/tlv.c @ 10986:ecc0f22db510
[gaim-migrate @ 12822]
This gets rid of a fair number of signedness warnings with gcc4 -Wall
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 09 Jun 2005 03:58:58 +0000 |
parents | cee849d17167 |
children | 8d74ae785a46 |
line wrap: on
line diff
--- a/src/protocols/oscar/tlv.c Thu Jun 09 02:22:36 2005 +0000 +++ b/src/protocols/oscar/tlv.c Thu Jun 09 03:58:58 2005 +0000 @@ -20,7 +20,7 @@ if (!oldtlv || !*oldtlv) return; - + free((*oldtlv)->value); free(*oldtlv); *oldtlv = NULL; @@ -48,7 +48,7 @@ faim_internal aim_tlvlist_t *aim_tlvlist_read(aim_bstream_t *bs) { aim_tlvlist_t *list = NULL, *cur; - + while (aim_bstream_empty(bs) > 0) { fu16_t type, length; @@ -316,7 +316,7 @@ for (cur = *list; cur; ) { aim_tlvlist_t *tmp; - + freetlv(&cur->tlv); tmp = cur->next; @@ -463,6 +463,19 @@ } /** + * Add a string to a TLV chain. + * + * @param list Destination chain. + * @param type TLV type to add. + * @param value Value to add. + * @return The size of the value added. + */ +faim_internal int aim_tlvlist_add_string(aim_tlvlist_t **list, const fu16_t type, const char *value) +{ + return aim_tlvlist_add_raw(list, type, strlen(value), (fu8_t)value); +} + +/** * Adds a block of capability blocks to a TLV chain. The bitfield * passed in should be a bitwise %OR of any of the %AIM_CAPS constants: * @@ -528,7 +541,7 @@ aim_bstream_t bs; len = 2 + 1 + strlen(roomname) + 2; - + if (!(buf = malloc(len))) return 0;