summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-02-05 11:04:38 +0100
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-02-05 11:07:43 +0100
commit71f8cb835fc1ef7228055f6d3a4d8a9b3cd2a982 (patch)
treef1630fe177a3ea47d0f472d4993f17c67249a1eb
parentec113e27a9a6f31c1c5d81cf8818b46366e89871 (diff)
downloadqt-creator-71f8cb835fc1ef7228055f6d3a4d8a9b3cd2a982.tar.gz
Fixed the libs patcher paths
It was taking the wrong length when constructing the new paths. Reviewed-by: Danimo
-rw-r--r--src/tools/qtlibspatcher/qtlibspatchermain.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp
index b66a35f294..df7a927d41 100644
--- a/src/tools/qtlibspatcher/qtlibspatchermain.cpp
+++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp
@@ -136,7 +136,6 @@ char * allocFileNameCopyAppend(const char * textToCopy,
Q_ASSERT(textToAppend != NULL);
if (textToAppend2 == NULL)
textToAppend2 = "";
- Q_ASSERT(textToAppend2 != NULL);
char * const res = new char[bytesToAllocate];
const size_t textToCopyLen = strlen(textToCopy);
@@ -153,7 +152,7 @@ char * allocFileNameCopyAppend(const char * textToCopy,
if (textToAppendLen > 0)
strncpy(res + textToCopyLen, textToAppend, bytesToAllocate - textToCopyLen - 1);
if (textToAppend2Len > 0)
- strncpy(res + textToCopyLen + textToAppend2Len, textToAppend2, bytesToAllocate - textToCopyLen - textToAppend2Len - 1);
+ strncpy(res + textToCopyLen + textToAppendLen, textToAppend2, bytesToAllocate - textToCopyLen - textToAppendLen - 1);
res[textToCopyLen + textToAppendLen + textToAppend2Len] = '\0';
res[bytesToAllocate - 1] = '\0'; // Safe is safe
return res;