diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-02-20 12:22:48 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-02-20 12:22:48 +0100 |
commit | bc06de5e32e8f8ab7e7b8f9619030f48bc0c32b4 (patch) | |
tree | bb5192a2db189996bd0cca6e4ae344af67bd5791 /cpp | |
parent | Fixed ICE-5265 - Catch exceptions from HostName construction (diff) | |
download | ice-bc06de5e32e8f8ab7e7b8f9619030f48bc0c32b4.tar.bz2 ice-bc06de5e32e8f8ab7e7b8f9619030f48bc0c32b4.tar.xz ice-bc06de5e32e8f8ab7e7b8f9619030f48bc0c32b4.zip |
Fixed ICE-5262 - Ice/custom test failure, bogus pointer arithmetic
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/test/Ice/custom/CustomBuffer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cpp/test/Ice/custom/CustomBuffer.h b/cpp/test/Ice/custom/CustomBuffer.h index 62c5caf74e2..ee60cba273a 100644 --- a/cpp/test/Ice/custom/CustomBuffer.h +++ b/cpp/test/Ice/custom/CustomBuffer.h @@ -160,7 +160,7 @@ struct StreamHelper< ::Test::CustomBuffer<T>, StreamHelperCategorySequence> template<class S> static inline void write(S* stream, const ::Test::CustomBuffer<T>& v) { - stream->write(v.get(), v.get() + v.count() * sizeof(T)); + stream->write(v.get(), v.get() + v.count()); } template<class S> static inline void @@ -170,7 +170,7 @@ struct StreamHelper< ::Test::CustomBuffer<T>, StreamHelperCategorySequence> std::pair<const T*, const T*> a; stream->read(a, p); T* b = p.release(); - size_t count = (a.second - a.first) / sizeof(T); + size_t count = a.second - a.first; if(b == 0) { b = new T[count]; |