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:
parent
d6e6f46029
commit
8238de67e1
4 changed files with 20 additions and 27 deletions
|
@ -910,8 +910,8 @@ t MSG_212 "فشلت"
|
||||||
t MSG_213 "إطلاق تطبيق جديد..."
|
t MSG_213 "إطلاق تطبيق جديد..."
|
||||||
t MSG_214 "فشل إطلاق تطبيق جديد"
|
t MSG_214 "فشل إطلاق تطبيق جديد"
|
||||||
# Open/Save file
|
# Open/Save file
|
||||||
t MSG_215 "فتح %s"
|
t MSG_215 "فتح %s"
|
||||||
t MSG_216 "حفظ %s"
|
t MSG_216 "حفظ %s"
|
||||||
# Formatting status (make sure you use a double % to print the percent sign)
|
# Formatting status (make sure you use a double % to print the percent sign)
|
||||||
t MSG_217 "فرمتة: تم %0.1f%%"
|
t MSG_217 "فرمتة: تم %0.1f%%"
|
||||||
t MSG_218 "إنشاء نظام الملفات: تمت %d/%d عملية"
|
t MSG_218 "إنشاء نظام الملفات: تمت %d/%d عملية"
|
||||||
|
@ -6649,8 +6649,8 @@ t MSG_212 "נכשל"
|
||||||
t MSG_213 "פותח את היישום החדש..."
|
t MSG_213 "פותח את היישום החדש..."
|
||||||
t MSG_214 "נכשל בפתיחת היישום החדש"
|
t MSG_214 "נכשל בפתיחת היישום החדש"
|
||||||
# Open/Save file
|
# Open/Save file
|
||||||
t MSG_215 "הקובץ %s נפתח"
|
t MSG_215 "הקובץ %s נפתח"
|
||||||
t MSG_216 "הקובץ %s נשמר"
|
t MSG_216 "הקובץ %s נשמר"
|
||||||
# Formatting status (make sure you use a double % to print the percent sign)
|
# Formatting status (make sure you use a double % to print the percent sign)
|
||||||
t MSG_217 "מאתחל: %0.1f%% הושלמו"
|
t MSG_217 "מאתחל: %0.1f%% הושלמו"
|
||||||
t MSG_218 "יוצר מערכת קבצים: משימה %d/%d הושלמה"
|
t MSG_218 "יוצר מערכת קבצים: משימה %d/%d הושלמה"
|
||||||
|
@ -11194,8 +11194,8 @@ t MSG_212 "ناموفق بود"
|
||||||
t MSG_213 "در حال راهاندازی نسخه جدید نرمافزار..."
|
t MSG_213 "در حال راهاندازی نسخه جدید نرمافزار..."
|
||||||
t MSG_214 "راهاندازی نسخه جدید نرمافزار ناموفق بود"
|
t MSG_214 "راهاندازی نسخه جدید نرمافزار ناموفق بود"
|
||||||
# Open/Save file
|
# Open/Save file
|
||||||
t MSG_215 "%s باز شد"
|
t MSG_215 "%s باز شد"
|
||||||
t MSG_216 "%s ذخیره شد"
|
t MSG_216 "%s ذخیره شد"
|
||||||
# Formatting status (make sure you use a double % to print the percent sign)
|
# Formatting status (make sure you use a double % to print the percent sign)
|
||||||
t MSG_217 "در حال فرمت کردن؛ درصد پیشرفت: %0.1f%%"
|
t MSG_217 "در حال فرمت کردن؛ درصد پیشرفت: %0.1f%%"
|
||||||
t MSG_218 "در حال ساختن سیستم فایل؛ تعداد وظایف انجام شده: %d/%d"
|
t MSG_218 "در حال ساختن سیستم فایل؛ تعداد وظایف انجام شده: %d/%d"
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 3.1.1313"
|
CAPTION "Rufus 3.1.1314"
|
||||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||||
|
@ -389,8 +389,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 3,1,1313,0
|
FILEVERSION 3,1,1314,0
|
||||||
PRODUCTVERSION 3,1,1313,0
|
PRODUCTVERSION 3,1,1314,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -407,13 +407,13 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "3.1.1313"
|
VALUE "FileVersion", "3.1.1314"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus.exe"
|
VALUE "OriginalFilename", "rufus.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "3.1.1313"
|
VALUE "ProductVersion", "3.1.1314"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
12
src/stdfn.c
12
src/stdfn.c
|
@ -463,7 +463,6 @@ BOOL FileIO(BOOL save, char* path, char** buffer, DWORD* size)
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
BOOL r;
|
BOOL r;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
char* ltr_path;
|
|
||||||
|
|
||||||
// Change the owner from admin to regular user
|
// Change the owner from admin to regular user
|
||||||
sid = GetSID();
|
sid = GetSID();
|
||||||
|
@ -506,16 +505,7 @@ BOOL FileIO(BOOL save, char* path, char** buffer, DWORD* size)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that the path is always displayed LTR
|
PrintInfoDebug(0, save?MSG_216:MSG_215, path);
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
13
src/stdlg.c
13
src/stdlg.c
|
@ -774,16 +774,19 @@ BOOL Notification(int type, const notification_info* more_info, char* title, cha
|
||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
const int max_msg_size = 1024;
|
||||||
|
|
||||||
dialog_showing++;
|
dialog_showing++;
|
||||||
szMessageText = (char*)malloc(MAX_PATH);
|
szMessageText = (char*)malloc(max_msg_size);
|
||||||
if (szMessageText == NULL) return FALSE;
|
if (szMessageText == NULL)
|
||||||
|
return FALSE;
|
||||||
szMessageTitle = safe_strdup(title);
|
szMessageTitle = safe_strdup(title);
|
||||||
if (szMessageTitle == NULL) return FALSE;
|
if (szMessageTitle == NULL)
|
||||||
|
return FALSE;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
safe_vsnprintf(szMessageText, MAX_PATH-1, format, args);
|
safe_vsnprintf(szMessageText, max_msg_size -1, format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
szMessageText[MAX_PATH-1] = 0;
|
szMessageText[max_msg_size -1] = 0;
|
||||||
notification_more_info = more_info;
|
notification_more_info = more_info;
|
||||||
notification_is_question = FALSE;
|
notification_is_question = FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue