summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/debug/HyprCtl.cpp2
-rw-r--r--src/render/OpenGL.cpp3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 15847d18..30126a92 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -2026,7 +2026,7 @@ void CHyprCtl::startHyprCtlSocket() {
m_socketPath = g_pCompositor->m_instancePath + "/.socket.sock";
- strcpy(SERVERADDRESS.sun_path, m_socketPath.c_str());
+ snprintf(SERVERADDRESS.sun_path, sizeof(SERVERADDRESS.sun_path), "%s", m_socketPath.c_str());
if (bind(m_socketFD.get(), (sockaddr*)&SERVERADDRESS, SUN_LEN(&SERVERADDRESS)) < 0) {
Debug::log(ERR, "Couldn't start the Hyprland Socket. (2) IPC will not work.");
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index b1dfc073..6737f8c1 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -107,8 +107,7 @@ static int openRenderNode(int drmFd) {
Debug::log(LOG, "DRM dev versionName", render_version->name);
if (strcmp(render_version->name, "evdi") == 0) {
free(renderName);
- renderName = (char*)malloc(sizeof(char) * 15);
- strcpy(renderName, "/dev/dri/card0");
+ renderName = strdup("/dev/dri/card0");
}
drmFreeVersion(render_version);
}