From 7b693627ee2a17718cb6d8bee5e3deb5a97b307f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 22 Aug 2011 11:30:26 +0200 Subject: Off-by-one error in assert condition... While this was safe, it was also over-zealous, disallowing the path from ending with the placeholder... Incidentally, the default. Laughed-at-by: w00t_ --- src/corelib/io/qtemporaryfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index ea5f8a5..e80a8b6 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -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; -- cgit v0.12