]> andersk Git - libfaim.git/blobdiff - aim_tlv.c
- Tue Oct 17 02:10:13 UTC 2000
[libfaim.git] / aim_tlv.c
index 3557d5a643208331a6df6d1f3dcec52a51c28d87..75cc7eaa976ab529195572dd4955cabfb2c68de5 100644 (file)
--- a/aim_tlv.c
+++ b/aim_tlv.c
@@ -212,12 +212,15 @@ faim_internal int aim_addtlvtochain_caps(struct aim_tlvlist_t **list, unsigned s
   if(!list)
     return 0;
 
+  newtl = (struct aim_tlvlist_t *)malloc(sizeof(struct aim_tlvlist_t));
+  memset(newtl, 0x00, sizeof(struct aim_tlvlist_t));
+
   newtl->tlv = aim_createtlv();        
   newtl->tlv->type = type;
 
-  newtl->tlv->length = aim_putcap(buf, 128, caps);
+  newtl->tlv->length = aim_putcap(buf, sizeof(buf), caps);
   newtl->tlv->value = (unsigned char *)calloc(1, newtl->tlv->length);
-  memcpy(newtl->tlv->value, &buf, newtl->tlv->length);
+  memcpy(newtl->tlv->value, buf, newtl->tlv->length);
 
   newtl->next = NULL;
 
This page took 0.032484 seconds and 4 git commands to generate.