https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r339830 | igorg | 2011-10-08 21:56:35 +0700 (Сбт, 08 Окт 2011) | 8 lines
Fix char array cast as short array in send_client() function (for ARM
platform)
(closes issue ASTERISK-17314)
Reported by: jjoshua
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@339831
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
{
unsigned int tick;
int buf_pos;
- unsigned short *sdata = (unsigned short *) data;
+ unsigned short seq = ntohs(++pte->seq_server);
ast_mutex_lock(&pte->lock);
buf_pos = pte->last_buf_available;
ast_mutex_unlock(&pte->lock);
return;
}
- sdata[1] = ntohs(++(pte->seq_server));
+ memcpy((void *)data + sizeof(unsigned short), (void *)&seq, sizeof(unsigned short));
pte->wsabufsend[buf_pos].len = size;
memcpy(pte->wsabufsend[buf_pos].buf, data, size);