提交 4b6ccfde 编写于 作者: B bellard

fixed realloc logic (Ed Swierk)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1879 c046a42c-6fe2-441c-8c8c-71466251a162
上级 7d510b8c
...@@ -146,18 +146,19 @@ m_inc(m, size) ...@@ -146,18 +146,19 @@ m_inc(m, size)
struct mbuf *m; struct mbuf *m;
int size; int size;
{ {
int datasize;
/* some compiles throw up on gotos. This one we can fake. */ /* some compiles throw up on gotos. This one we can fake. */
if(m->m_size>size) return; if(m->m_size>size) return;
if (m->m_flags & M_EXT) { if (m->m_flags & M_EXT) {
/* datasize = m->m_data - m->m_ext; */ datasize = m->m_data - m->m_ext;
m->m_ext = (char *)realloc(m->m_ext,size); m->m_ext = (char *)realloc(m->m_ext,size);
/* if (m->m_ext == NULL) /* if (m->m_ext == NULL)
* return (struct mbuf *)NULL; * return (struct mbuf *)NULL;
*/ */
/* m->m_data = m->m_ext + datasize; */ m->m_data = m->m_ext + datasize;
} else { } else {
int datasize;
char *dat; char *dat;
datasize = m->m_data - m->m_dat; datasize = m->m_data - m->m_dat;
dat = (char *)malloc(size); dat = (char *)malloc(size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册