diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-01-23 20:08:43 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-02-04 14:03:13 +0100 |
commit | 818694ba6aed9eb4034ede40d9fdcce84b077933 (patch) | |
tree | f74d709cf7455efce292606f09d3e944ed74c7d6 /win | |
parent | 51347ef875085957a36477284112dc51b6cbd990 (diff) | |
download | tigervnc-818694ba6aed9eb4034ede40d9fdcce84b077933.tar.gz tigervnc-818694ba6aed9eb4034ede40d9fdcce84b077933.zip |
Use string literal instead of dynamic buffer
These don't need to be changed, so let's just keep it simple with a
constant string literal.
Diffstat (limited to 'win')
-rw-r--r-- | win/winvnc/ControlPanel.cxx | 2 | ||||
-rw-r--r-- | win/winvnc/ListConnInfo.h | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/win/winvnc/ControlPanel.cxx b/win/winvnc/ControlPanel.cxx index ff4a63a1..1b3c40eb 100644 --- a/win/winvnc/ControlPanel.cxx +++ b/win/winvnc/ControlPanel.cxx @@ -88,7 +88,7 @@ void ControlPanel::UpdateListView(ListConnInfo* LCInfo) ListConn.Copy(LCInfo); - char* ItemString[2]; + const char* ItemString[2]; int i = 0; for (ListConn.iBegin(); !ListConn.iEnd(); ListConn.iNext()) { diff --git a/win/winvnc/ListConnInfo.h b/win/winvnc/ListConnInfo.h index 6ca5b7c7..f779cf5d 100644 --- a/win/winvnc/ListConnInfo.h +++ b/win/winvnc/ListConnInfo.h @@ -51,26 +51,26 @@ namespace winvnc { si++; } - void addInfo(void* Conn, char* IP, int Status) { + void addInfo(void* Conn, const char* IP, int Status) { conn.push_back(Conn); IP_address.push_back(rfb::strDup(IP)); status.push_back(Status); } - void iGetCharInfo(char* buf[2]) { + void iGetCharInfo(const char* buf[2]) { buf[0] = *Ii; switch (*si) { case 0: - buf[1] = rfb::strDup("Full control"); + buf[1] = "Full control"; break; case 1: - buf[1] = rfb::strDup("View only"); + buf[1] = "View only"; break; case 2: - buf[1] = rfb::strDup("Stop updating"); + buf[1] = "Stop updating"; break; default: - buf[1] = rfb::strDup("Unknown"); + buf[1] = "Unknown"; } } @@ -90,7 +90,7 @@ namespace winvnc { } void iAdd (ListConnInfo* InputList) { - char* buf[2]; + const char* buf[2]; InputList->iGetCharInfo(buf); addInfo(InputList->iGetConn(), buf[0], InputList->iGetStatus()); } |