[ui] fix more potential notification message truncation

* Some Thai UTF-8 notification messages went over the buffer size limit we used for vsnprintf()
* Also, revert part of 645184f11e and use LRE+PDF marks instead:
  Don't handle in the code what is better handled in the loc file.
This commit is contained in:
Pete Batard 2018-06-08 16:29:41 +01:00
parent d6e6f46029
commit 8238de67e1
4 changed files with 20 additions and 27 deletions

View file

@ -463,7 +463,6 @@ BOOL FileIO(BOOL save, char* path, char** buffer, DWORD* size)
HANDLE handle;
BOOL r;
BOOL ret = FALSE;
char* ltr_path;
// Change the owner from admin to regular user
sid = GetSID();
@ -506,16 +505,7 @@ BOOL FileIO(BOOL save, char* path, char** buffer, DWORD* size)
goto out;
}
// Ensure that the path is always displayed LTR
// Use of sizeof gets us the extra char needed for NUL terminator
ltr_path = malloc(safe_strlen(path) + sizeof(LEFT_TO_RIGHT_EMBEDDING) + sizeof(POP_DIRECTIONAL_FORMATTING));
if (ltr_path == NULL) {
PrintInfoDebug(0, save ? MSG_216 : MSG_215, path);
} else {
sprintf(ltr_path, "%s%s%s", LEFT_TO_RIGHT_EMBEDDING, path, POP_DIRECTIONAL_FORMATTING);
PrintInfoDebug(0, save ? MSG_216 : MSG_215, ltr_path);
free(ltr_path);
}
PrintInfoDebug(0, save?MSG_216:MSG_215, path);
ret = TRUE;
out: