diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-01-15 14:41:47 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-02-04 14:03:13 +0100 |
commit | d608a30d576ed74f7dc7374c1f00d2303fee27f6 (patch) | |
tree | a6637dee5800ee1f9af6331d3df02d84afe45d9a /vncviewer/DesktopWindow.cxx | |
parent | ef8c84eb752e1b59ef824cedeb156b2d64fefe37 (diff) | |
download | tigervnc-d608a30d576ed74f7dc7374c1f00d2303fee27f6.tar.gz tigervnc-d608a30d576ed74f7dc7374c1f00d2303fee27f6.zip |
Use fixed size character buffer
We know the needed space here, so let's keep it simple with a constant
size string buffer.
Diffstat (limited to 'vncviewer/DesktopWindow.cxx')
-rw-r--r-- | vncviewer/DesktopWindow.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 4eccbf52..3584845e 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -281,12 +281,11 @@ const rfb::PixelFormat &DesktopWindow::getPreferredPF() void DesktopWindow::setName(const char *name) { - CharArray windowNameStr; - windowNameStr.replaceBuf(new char[256]); + char windowNameStr[256]; - snprintf(windowNameStr.buf, 256, "%.240s - TigerVNC", name); + snprintf(windowNameStr, 256, "%.240s - TigerVNC", name); - copy_label(windowNameStr.buf); + copy_label(windowNameStr); } |