Off-by-one error in assert condition...
authorJoão Abecasis <joao.abecasis@nokia.com>
Mon, 22 Aug 2011 09:30:26 +0000 (11:30 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 21 Oct 2011 20:20:55 +0000 (22:20 +0200)
While this was safe, it was also over-zealous, disallowing the path from
ending with the placeholder... Incidentally, the default.

Laughed-at-by: w00t_
(cherry picked from commit 7b693627ee2a17718cb6d8bee5e3deb5a97b307f)

Change-Id: I61a1511bca5cafe2edde20ef38c23154200dfcab
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
src/corelib/io/qtemporaryfile.cpp

index afef674..ebcaaa7 100644 (file)
@@ -135,7 +135,7 @@ static bool createFileFromTemplate(NativeFileHandle &file,
 {
     Q_ASSERT(length != 0);
     Q_ASSERT(pos < size_t(path.length()));
-    Q_ASSERT(length < size_t(path.length()) - pos);
+    Q_ASSERT(length <= size_t(path.length()) - pos);
 
     Char *const placeholderStart = (Char *)path.data() + pos;
     Char *const placeholderEnd = placeholderStart + length;