diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-05-01 10:59:02 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-05-01 10:59:02 +0000 |
commit | 4b6ccfdec99e9e3a22566beac76b83d7ff025bff (patch) | |
tree | a5bffc46af0bab175088147eb85c18992beaae53 | |
parent | 7d510b8c0c31645a1600e7a2e196f4629a472ae0 (diff) |
fixed realloc logic (Ed Swierk)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1879 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | slirp/mbuf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/slirp/mbuf.c b/slirp/mbuf.c index fa36d89507..3769bafd29 100644 --- a/slirp/mbuf.c +++ b/slirp/mbuf.c @@ -146,18 +146,19 @@ m_inc(m, size) struct mbuf *m; int size; { + int datasize; + /* some compiles throw up on gotos. This one we can fake. */ if(m->m_size>size) return; 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); /* if (m->m_ext == NULL) * return (struct mbuf *)NULL; */ - /* m->m_data = m->m_ext + datasize; */ + m->m_data = m->m_ext + datasize; } else { - int datasize; char *dat; datasize = m->m_data - m->m_dat; dat = (char *)malloc(size); |