1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[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

@ -910,8 +910,8 @@ t MSG_212 "فشلت"
t MSG_213 "إطلاق تطبيق جديد..."
t MSG_214 "فشل إطلاق تطبيق جديد"
# Open/Save file
t MSG_215 "فتح %s"
t MSG_216 "حفظ %s"
t MSG_215 "فتح %s"
t MSG_216 "حفظ %s"
# Formatting status (make sure you use a double % to print the percent sign)
t MSG_217 "فرمتة: تم %0.1f%%"
t MSG_218 "إنشاء نظام الملفات: تمت %d/%d عملية"
@ -6649,8 +6649,8 @@ t MSG_212 "נכשל"
t MSG_213 "פותח את היישום החדש..."
t MSG_214 "נכשל בפתיחת היישום החדש"
# Open/Save file
t MSG_215 "הקובץ %s נפתח"
t MSG_216 "הקובץ %s נשמר"
t MSG_215 "הקובץ %s נפתח"
t MSG_216 "הקובץ %s נשמר"
# Formatting status (make sure you use a double % to print the percent sign)
t MSG_217 "מאתחל: %0.1f%% הושלמו"
t MSG_218 "יוצר מערכת קבצים: משימה %d/%d הושלמה"
@ -11194,8 +11194,8 @@ t MSG_212 "ناموفق بود"
t MSG_213 "در حال راه‌اندازی نسخه جدید نرم‌افزار..."
t MSG_214 "راه‌اندازی نسخه جدید نرم‌افزار ناموفق بود"
# Open/Save file
t MSG_215 "%s باز شد"
t MSG_216 "%s ذخیره شد"
t MSG_215 "%s باز شد"
t MSG_216 "%s ذخیره شد"
# Formatting status (make sure you use a double % to print the percent sign)
t MSG_217 "در حال فرمت کردن؛ درصد پیشرفت: %0.1f%%"
t MSG_218 "در حال ساختن سیستم فایل؛ تعداد وظایف انجام شده: %d/%d"

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.1.1313"
CAPTION "Rufus 3.1.1314"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -389,8 +389,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,1,1313,0
PRODUCTVERSION 3,1,1313,0
FILEVERSION 3,1,1314,0
PRODUCTVERSION 3,1,1314,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -407,13 +407,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.1.1313"
VALUE "FileVersion", "3.1.1314"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.1.1313"
VALUE "ProductVersion", "3.1.1314"
END
END
BLOCK "VarFileInfo"

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:

View file

@ -774,16 +774,19 @@ BOOL Notification(int type, const notification_info* more_info, char* title, cha
{
BOOL ret;
va_list args;
const int max_msg_size = 1024;
dialog_showing++;
szMessageText = (char*)malloc(MAX_PATH);
if (szMessageText == NULL) return FALSE;
szMessageText = (char*)malloc(max_msg_size);
if (szMessageText == NULL)
return FALSE;
szMessageTitle = safe_strdup(title);
if (szMessageTitle == NULL) return FALSE;
if (szMessageTitle == NULL)
return FALSE;
va_start(args, format);
safe_vsnprintf(szMessageText, MAX_PATH-1, format, args);
safe_vsnprintf(szMessageText, max_msg_size -1, format, args);
va_end(args);
szMessageText[MAX_PATH-1] = 0;
szMessageText[max_msg_size -1] = 0;
notification_more_info = more_info;
notification_is_question = FALSE;