if (userDir)
return homedir;
- snprintf(dir, sizeof(dir), "%s/.vnc/", homedir);
+ snprintf(dir, sizeof(dir), "%s/.vnc", homedir);
return dir;
#else
if (userDir)
return dir;
- if (strlen(dir) + strlen("\\vnc\\") >= sizeof(dir))
+ if (strlen(dir) + strlen("\\vnc") >= sizeof(dir))
return NULL;
- strcat(dir, "\\vnc\\");
+ strcat(dir, "\\vnc");
return dir;
#endif
if (homedir == NULL)
return "";
- snprintf(full_path, sizeof(full_path), "%s%s", homedir, fn);
+ snprintf(full_path, sizeof(full_path), "%s/%s", homedir, fn);
return full_path;
}
"path for known hosts storage");
}
- CharArray dbPath(strlen(homeDir) + 16 + 1);
- sprintf(dbPath.buf, "%sx509_known_hosts", homeDir);
+ CharArray dbPath(strlen(homeDir) + strlen("/x509_known_hosts") + 1);
+ sprintf(dbPath.buf, "%s/x509_known_hosts", homeDir);
err = gnutls_verify_stored_pubkey(dbPath.buf, NULL,
client->getServerName(), NULL,
exit(1);
}
mkdir(homeDir, 0777);
- fname = new char[strlen(homeDir) + 7];
- sprintf(fname, "%spasswd", homeDir);
+ fname = new char[strlen(homeDir) + strlen("/passwd") + 1];
+ sprintf(fname, "%s/passwd", homeDir);
}
while (true) {
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");
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+");
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);
}
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);
}