We want to actually encode each element and keep it, rather than
writing each one at the position after the array end!
Signed-off-by: Greg Farnum <greg@inktank.com>
inline void encode_array_nohead(const A a[], int n, bufferlist &bl)
{
for (int i=0; i<n; i++)
- encode(a[n], bl);
+ encode(a[i], bl);
}
template<class A>
inline void decode_array_nohead(A a[], int n, bufferlist::iterator &p)
{
for (int i=0; i<n; i++)
- decode(a[n], p);
+ decode(a[i], p);
}