summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2015-07-31 14:15:56 +0200
committerDavid Faure <david.faure@kdab.com>2015-08-13 08:54:47 +0000
commit109cdeda3008fe57aabf2385f95cf8e55b8c7da2 (patch)
tree53cfe25800ca9f4dc119bf3375fb87855d9a6c25 /src
parent314c83c0c2f91532654f869b7dc6af1b7e8538da (diff)
qprintdialog_unix.cpp: fix out-of-bounds when cwd is empty.
This happens when the cwd got deleted meanwhile; this warning is printed out: QFileSystemEngine::currentPath: getcwd() failed and currentPath() is empty. Not a problem in itself, but qprintdialog should not assume it's not empty, then. Change-Id: I5c89992b36ca58b6325ced399cff33aca9efb7ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index f3be45262b..502ff7d98a 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -803,7 +803,7 @@ void QUnixPrintWidgetPrivate::applyPrinterProperties()
QString cur = QDir::currentPath();
if (home.at(home.length()-1) != QLatin1Char('/'))
home += QLatin1Char('/');
- if (cur.at(cur.length()-1) != QLatin1Char('/'))
+ if (!cur.isEmpty() && cur.at(cur.length()-1) != QLatin1Char('/'))
cur += QLatin1Char('/');
if (cur.left(home.length()) != home)
cur = home;