| 380 * @param datalen The size of the avatar data |
380 * @param datalen The size of the avatar data |
| 381 * @return The number of bytes encoded in the buffer |
381 * @return The number of bytes encoded in the buffer |
| 382 */ |
382 */ |
| 383 int mxit_chunk_create_set_avatar( char* chunkdata, const unsigned char* data, int datalen ) |
383 int mxit_chunk_create_set_avatar( char* chunkdata, const unsigned char* data, int datalen ) |
| 384 { |
384 { |
| 385 const char fileid[MXIT_CHUNK_FILEID_LEN]; |
385 char fileid[MXIT_CHUNK_FILEID_LEN]; |
| 386 int pos = 0; |
386 int pos = 0; |
| 387 |
387 |
| 388 /* id [8 bytes] */ |
388 /* id [8 bytes] */ |
| 389 memset( &fileid, 0, sizeof( fileid ) ); /* set to 0 for file upload */ |
389 memset( &fileid, 0, sizeof( fileid ) ); /* set to 0 for file upload */ |
| 390 pos += add_data( &chunkdata[pos], fileid, MXIT_CHUNK_FILEID_LEN ); |
390 pos += add_data( &chunkdata[pos], fileid, MXIT_CHUNK_FILEID_LEN ); |