qt: GL core; use safe version of strcpy
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
* Copyright 2022 Teemu Korhonen
|
* Copyright 2022 Teemu Korhonen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <QByteArray>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
@@ -89,7 +90,7 @@ OpenGLOptions::save() const
|
|||||||
auto path = m_shaders.first().path().toLocal8Bit();
|
auto path = m_shaders.first().path().toLocal8Bit();
|
||||||
|
|
||||||
if (!path.isEmpty())
|
if (!path.isEmpty())
|
||||||
strcpy(video_shader, path.constData());
|
qstrncpy(video_shader, path.constData(), sizeof(video_shader));
|
||||||
else
|
else
|
||||||
video_shader[0] = '\0';
|
video_shader[0] = '\0';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user