From: Scott Wheeler Date: Sat, 10 Apr 2004 18:39:17 +0000 (+0000) Subject: Sadly reserve() just changes the capacity, not the actual size of the vector X-Git-Tag: v1.5~408 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a1c3618ec88b95e2b5fd71a7d830bab89a1b34c;p=taglib Sadly reserve() just changes the capacity, not the actual size of the vector so this didn't update the internal size of the std::vector... git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@302668 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- diff --git a/toolkit/tbytevector.cpp b/toolkit/tbytevector.cpp index c67662cd..5a27c60c 100644 --- a/toolkit/tbytevector.cpp +++ b/toolkit/tbytevector.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - copyright : (C) 2002, 2003 by Scott Wheeler + copyright : (C) 2002 - 2004 by Scott Wheeler email : wheeler@kde.org ***************************************************************************/ @@ -424,7 +424,7 @@ ByteVector &ByteVector::resize(uint size, char padding) { if(d->size < size) { d->data.reserve(size); - ::memset(DATA(d), padding, size - d->size); + d->data.insert(d->data.end(), size - d->size, padding); } else d->data.erase(d->data.begin() + size, d->data.end()); diff --git a/toolkit/tbytevector.h b/toolkit/tbytevector.h index 2788e6f7..8a7b8cfd 100644 --- a/toolkit/tbytevector.h +++ b/toolkit/tbytevector.h @@ -1,5 +1,5 @@ /*************************************************************************** - copyright : (C) 2002, 2003 by Scott Wheeler + copyright : (C) 2002 - 2004 by Scott Wheeler email : wheeler@kde.org ***************************************************************************/