aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-17 19:09:26 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commitef8c84eb752e1b59ef824cedeb156b2d64fefe37 (patch)
tree4ddde34cbd29da534fb8f43fd505aca80a96a3f1 /vncviewer
parent803a6ae087331d2701daf608128c2e5ff1d596a7 (diff)
downloadtigervnc-ef8c84eb752e1b59ef824cedeb156b2d64fefe37.tar.gz
tigervnc-ef8c84eb752e1b59ef824cedeb156b2d64fefe37.zip
Remove trailing slash from getvnchomedir()
It should return a path to the directory itself, just like its sister function getuserhomedir().
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/ServerDialog.cxx4
-rw-r--r--vncviewer/parameters.cxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/vncviewer/ServerDialog.cxx b/vncviewer/ServerDialog.cxx
index a6b0e80f..db39cd59 100644
--- a/vncviewer/ServerDialog.cxx
+++ b/vncviewer/ServerDialog.cxx
@@ -320,7 +320,7 @@ void ServerDialog::loadServerHistory()
throw Exception(_("Could not obtain the home directory path"));
char filepath[PATH_MAX];
- snprintf(filepath, sizeof(filepath), "%s%s", homeDir, SERVER_HISTORY);
+ snprintf(filepath, sizeof(filepath), "%s/%s", homeDir, SERVER_HISTORY);
/* Read server history from file */
FILE* f = fopen(filepath, "r");
@@ -386,7 +386,7 @@ void ServerDialog::saveServerHistory()
throw Exception(_("Could not obtain the home directory path"));
char filepath[PATH_MAX];
- snprintf(filepath, sizeof(filepath), "%s%s", homeDir, SERVER_HISTORY);
+ snprintf(filepath, sizeof(filepath), "%s/%s", homeDir, SERVER_HISTORY);
/* Write server history to file */
FILE* f = fopen(filepath, "w+");
diff --git a/vncviewer/parameters.cxx b/vncviewer/parameters.cxx
index 03f2b145..ff5589d2 100644
--- a/vncviewer/parameters.cxx
+++ b/vncviewer/parameters.cxx
@@ -633,7 +633,7 @@ void saveViewerParameters(const char *filename, const char *servername) {
if (homeDir == NULL)
throw Exception(_("Could not obtain the home directory path"));
- snprintf(filepath, sizeof(filepath), "%sdefault.tigervnc", homeDir);
+ snprintf(filepath, sizeof(filepath), "%s/default.tigervnc", homeDir);
} else {
snprintf(filepath, sizeof(filepath), "%s", filename);
}
@@ -737,7 +737,7 @@ char* loadViewerParameters(const char *filename) {
if (homeDir == NULL)
throw Exception(_("Could not obtain the home directory path"));
- snprintf(filepath, sizeof(filepath), "%sdefault.tigervnc", homeDir);
+ snprintf(filepath, sizeof(filepath), "%s/default.tigervnc", homeDir);
} else {
snprintf(filepath, sizeof(filepath), "%s", filename);
}