summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-01-23 11:33:10 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-02-12 09:58:06 +0000
commit4b9a0c0a7c739650d0e123032be517eb40c2f32c (patch)
treebc173dbaa7ebb7716d976a6ea598e5276084a4c3 /src/corelib/global
parentd251cae7b7370af328307948aca9bb63def22fe4 (diff)
QLogging: migrate to QString::(v)asprintf
Change-Id: I63141c258c9409b03ce23cd77b90c4e4bc3487ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qlogging.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 4fb5d7ff1f..af5d7cf55a 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -253,7 +253,7 @@ static void qt_message(QtMsgType msgType, const QMessageLogContext &context, con
{
if (msg)
- buf = QString().vsprintf(msg, ap);
+ buf = QString::vasprintf(msg, ap);
qt_message_print(msgType, context, buf);
}
@@ -1367,13 +1367,13 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
} else if (token == timeTokenC) {
if (pattern->timeFormat == QLatin1String("process")) {
quint64 ms = pattern->timer.elapsed();
- message.append(QString().sprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000)));
+ message.append(QString::asprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000)));
} else if (pattern->timeFormat == QLatin1String("boot")) {
// just print the milliseconds since the elapsed timer reference
// like the Linux kernel does
pattern->timer.elapsed();
uint ms = pattern->timer.msecsSinceReference();
- message.append(QString().sprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000)));
+ message.append(QString::asprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000)));
} else if (pattern->timeFormat.isEmpty()) {
message.append(QDateTime::currentDateTime().toString(Qt::ISODate));
} else {
@@ -1611,7 +1611,7 @@ void qErrnoWarning(const char *msg, ...)
va_list ap;
va_start(ap, msg);
if (msg)
- buf.vsprintf(msg, ap);
+ buf = QString::vasprintf(msg, ap);
va_end(ap);
buf += QLatin1String(" (") + qt_error_string(-1) + QLatin1Char(')');
@@ -1627,7 +1627,7 @@ void qErrnoWarning(int code, const char *msg, ...)
va_list ap;
va_start(ap, msg);
if (msg)
- buf.vsprintf(msg, ap);
+ buf = QString::vasprintf(msg, ap);
va_end(ap);
buf += QLatin1String(" (") + qt_error_string(code) + QLatin1Char(')');