plat: use size_t for global dir path buffer length
This commit is contained in:
@@ -143,8 +143,8 @@ extern int plat_getcwd(char *bufp, int max);
|
||||
extern int plat_chdir(char *path);
|
||||
extern void plat_tempfile(char *bufp, char *prefix, char *suffix);
|
||||
extern void plat_get_exe_name(char *s, int size);
|
||||
extern void plat_get_global_config_dir(char *outbuf, uint8_t len);
|
||||
extern void plat_get_global_data_dir(char *outbuf, uint8_t len);
|
||||
extern void plat_get_global_config_dir(char *outbuf, size_t len);
|
||||
extern void plat_get_global_data_dir(char *outbuf, size_t len);
|
||||
extern void plat_get_temp_dir(char *outbuf, uint8_t len);
|
||||
extern void plat_init_rom_paths(void);
|
||||
extern int plat_dir_check(char *path);
|
||||
|
||||
@@ -595,14 +595,14 @@ ProgSettings::reloadStrings()
|
||||
{
|
||||
translatedstrings.clear();
|
||||
translatedstrings[STRING_MOUSE_CAPTURE] = QCoreApplication::translate("", "Click to capture mouse").toStdWString();
|
||||
|
||||
|
||||
char mouseCaptureKeyseq[100];
|
||||
sprintf(mouseCaptureKeyseq, qPrintable(QCoreApplication::translate("", "Press %s to release mouse")), acc_keys[FindAccelerator("release_mouse")].seq);
|
||||
translatedstrings[STRING_MOUSE_RELEASE] = QString(mouseCaptureKeyseq).toStdWString();
|
||||
|
||||
|
||||
sprintf(mouseCaptureKeyseq, qPrintable(QCoreApplication::translate("", "Press %s or middle button to release mouse")), acc_keys[FindAccelerator("release_mouse")].seq);
|
||||
translatedstrings[STRING_MOUSE_RELEASE_MMB] = QString(mouseCaptureKeyseq).toStdWString();
|
||||
|
||||
translatedstrings[STRING_MOUSE_RELEASE_MMB] = QString(mouseCaptureKeyseq).toStdWString();
|
||||
|
||||
translatedstrings[STRING_INVALID_CONFIG] = QCoreApplication::translate("", "Invalid configuration").toStdWString();
|
||||
translatedstrings[STRING_NO_ST506_ESDI_CDROM] = QCoreApplication::translate("", "MFM/RLL or ESDI CD-ROM drives never existed").toStdWString();
|
||||
translatedstrings[STRING_PCAP_ERROR_NO_DEVICES] = QCoreApplication::translate("", "No PCap devices found").toStdWString();
|
||||
@@ -639,7 +639,7 @@ plat_chdir(char *path)
|
||||
}
|
||||
|
||||
void
|
||||
plat_get_global_config_dir(char *outbuf, const uint8_t len)
|
||||
plat_get_global_config_dir(char *outbuf, const size_t len)
|
||||
{
|
||||
const auto dir = QDir(QStandardPaths::standardLocations(QStandardPaths::AppConfigLocation)[0]);
|
||||
if (!dir.exists()) {
|
||||
@@ -651,7 +651,7 @@ plat_get_global_config_dir(char *outbuf, const uint8_t len)
|
||||
}
|
||||
|
||||
void
|
||||
plat_get_global_data_dir(char *outbuf, const uint8_t len)
|
||||
plat_get_global_data_dir(char *outbuf, const size_t len)
|
||||
{
|
||||
const auto dir = QDir(QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)[0]);
|
||||
if (!dir.exists()) {
|
||||
|
||||
@@ -844,7 +844,7 @@ plat_init_rom_paths(void)
|
||||
}
|
||||
|
||||
void
|
||||
plat_get_global_config_dir(char *outbuf, const uint8_t len)
|
||||
plat_get_global_config_dir(char *outbuf, const size_t len)
|
||||
{
|
||||
char *prefPath = SDL_GetPrefPath(NULL, "86Box");
|
||||
strncpy(outbuf, prefPath, len);
|
||||
@@ -853,7 +853,7 @@ plat_get_global_config_dir(char *outbuf, const uint8_t len)
|
||||
}
|
||||
|
||||
void
|
||||
plat_get_global_data_dir(char *outbuf, const uint8_t len)
|
||||
plat_get_global_data_dir(char *outbuf, const size_t len)
|
||||
{
|
||||
char *prefPath = SDL_GetPrefPath(NULL, "86Box");
|
||||
strncpy(outbuf, prefPath, len);
|
||||
|
||||
Reference in New Issue
Block a user