]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
encoding: fix [encode|decode]_array_nohead
authorGreg Farnum <greg@inktank.com>
Sat, 7 Dec 2013 02:19:13 +0000 (18:19 -0800)
committerGreg Farnum <greg@inktank.com>
Mon, 9 Dec 2013 06:21:41 +0000 (22:21 -0800)
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>
src/include/encoding.h

index fedc8b312997f8fea04d37f84a461b3a7c9f2878..cafebbf5de9a9551fa192b0f2ab7b70a2ea456af 100644 (file)
@@ -198,13 +198,13 @@ template<class A>
 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);
 }