From: Scott Wheeler Date: Sat, 7 Aug 2004 20:23:10 +0000 (+0000) Subject: Make sure that we're not setting the string size to -1. X-Git-Tag: v1.5~335 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=740f868333785354f0e40a8300cbd1b81e4e97dc;p=taglib Make sure that we're not setting the string size to -1. CCMAIL:ismail donmez git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@336760 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- diff --git a/toolkit/tstring.cpp b/toolkit/tstring.cpp index fe0588d3..c6b89218 100644 --- a/toolkit/tstring.cpp +++ b/toolkit/tstring.cpp @@ -677,7 +677,7 @@ void String::prepare(Type t) debug("String::prepare() - Unicode conversion error."); - int newSize = target - targetBuffer - 1; + int newSize = target != targetBuffer ? target - targetBuffer - 1 : 0; d->data.resize(newSize); for(int i = 0; i < newSize; i++)