Permalink
Browse files

Fix syslogGetFacility's use of QBytebuffer

Fixes #10624.

Signed-off-by: Gavin Hurlbut <ghurlbut@mythtv.org>
  • Loading branch information...
1 parent c5a9262 commit 9ea5252bc3a6367dacec1b4f92f03c13fbd0f0e4 @pepsiman pepsiman committed with Beirdo Apr 18, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 mythtv/libs/libmythbase/logging.cpp
@@ -1297,7 +1297,8 @@ int syslogGetFacility(QString facility)
#else
CODE *name;
int i;
- char *string = (char *)facility.toLocal8Bit().constData();
+ QByteArray ba = facility.toLocal8Bit();
+ char *string = (char *)ba.constData();
for (i = 0, name = &facilitynames[0];
name->c_name && strcmp(name->c_name, string); i++, name++);

2 comments on commit 9ea5252

@jyavenard
Member

This is a common issue in the Qt doc and is well documented.

Hopefully there aren't more like that thorough the code.

@pepsiman
Contributor

grep finds 2 more:

./mythtv/libs/libmythprotoserver/requesthandler/deletethread.cpp: const char *cpath = handler->m_path.toLocal8Bit().constData();
./mythtv/libs/libmythprotoserver/requesthandler/deletethread.cpp: cpath = handler->m_path.toLocal8Bit().constData();

Please sign in to comment.