]> git.ipfire.org Git - thirdparty/freeswitch.git/commit
Refactor to avoid warning about realloc usage
authorTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2014 01:33:22 +0000 (01:33 +0000)
committerTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2014 01:36:59 +0000 (01:36 +0000)
commit164fa133dc39e79a8f97d5a4e985285da0d13bad
tree6839aed5a9744bca856c1ba59702362daecb4e53
parent2cf6fd728c4516bec3606bdf27be029678e5f124
Refactor to avoid warning about realloc usage

Clang's static analyzer noticed the result of realloc was being
assigned to a pointer of a different type than was used to calculate
the new size.  We can make things simpler and more idiomatic here by
using the correct pointer type and letting C's pointer arithmetic
automatically handle some multiplication.

We also use the distributive property here to simplify the calculation
for memset.
src/switch_stfu.c