mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-20 18:05:21 -04:00
[ui] fix regression in conditional expression and use %c always
* This fixes the regression introduced in c28f9bc491
.
* 'if ((a && !b) || (!a && b))' can not always be simplified as 'if (a != b)' when the types for 'a' and 'b' are not straight booleans.
* Closes #1862
* Also drop the use of '%C' in printf() expression, as it is intended to print wide characters and not turn a char to uppercase.
This commit is contained in:
parent
891eb45549
commit
036f6260c5
6 changed files with 40 additions and 38 deletions
8
src/ui.c
8
src/ui.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Rufus: The Reliable USB Formatting Utility
|
||||
* UI-related function calls
|
||||
* Copyright © 2018-2021 Pete Batard <pete@akeo.ie>
|
||||
* Copyright © 2018-2022 Pete Batard <pete@akeo.ie>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -789,7 +789,8 @@ void ToggleImageOptions(void)
|
|||
if (image_option_txt[0] == 0)
|
||||
GetWindowTextU(GetDlgItem(hMainDialog, IDS_IMAGE_OPTION_TXT), image_option_txt, sizeof(image_option_txt));
|
||||
|
||||
if ((has_wintogo) != (image_options & IMOP_WINTOGO)) {
|
||||
if (((has_wintogo) && !(image_options & IMOP_WINTOGO)) ||
|
||||
((!has_wintogo) && (image_options & IMOP_WINTOGO))) {
|
||||
image_options ^= IMOP_WINTOGO;
|
||||
if (image_options & IMOP_WINTOGO) {
|
||||
// Set the Windows To Go selection in the dropdown
|
||||
|
@ -797,7 +798,8 @@ void ToggleImageOptions(void)
|
|||
}
|
||||
}
|
||||
|
||||
if ((has_persistence) != (image_options & IMOP_PERSISTENCE)) {
|
||||
if (((has_persistence) && !(image_options & IMOP_PERSISTENCE)) ||
|
||||
((!has_persistence) && (image_options & IMOP_PERSISTENCE))) {
|
||||
image_options ^= IMOP_PERSISTENCE;
|
||||
if (image_options & IMOP_PERSISTENCE) {
|
||||
SetWindowTextU(GetDlgItem(hMainDialog, IDS_IMAGE_OPTION_TXT), lmprintf(MSG_123));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue