From 9cd2a742710280b01443023b393fa21fd7681e08 Mon Sep 17 00:00:00 2001 From: Michael Flaherty Date: Sat, 4 May 2019 01:46:55 -0700 Subject: [PATCH] Fix ArgBuffer String Serialization (#999) --- public/sm_argbuffer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/sm_argbuffer.h b/public/sm_argbuffer.h index f951f9f8..e27c1338 100644 --- a/public/sm_argbuffer.h +++ b/public/sm_argbuffer.h @@ -37,7 +37,7 @@ template class ArgBuffer { public: - ArgBuffer(T t, Rest... rest) { + ArgBuffer(const T& t, const Rest&... rest) { unsigned char *ptr = buff; buildbuffer(&ptr, t, rest...); } @@ -60,13 +60,13 @@ private: } template - void buildbuffer(unsigned char **ptr, K k) { + void buildbuffer(unsigned char **ptr, K& k) { memcpy(*ptr, &k, sizeof(k)); *ptr += sizeof(K); } template - void buildbuffer(unsigned char **ptr, K k, Kn... kn) { + void buildbuffer(unsigned char **ptr, K& k, Kn&... kn) { buildbuffer(ptr, k); if (sizeof...(kn)!=0) buildbuffer(ptr, kn...);