mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-18 00:54:27 -04:00
[misc] fix PVS-Studio static analyzer warnings
* Surround macro params to ensure expected results * Fix copy-paste errors * Fix a potential buffer overflow in SetSectionHeaders() * Add const modifier where relevant * Use GetWindowLongPtr() everywhere * Use proper sprintf format for unsigned int * Use %s for printf-like funcs (https://www.viva64.com/en/w/v618/print/) * Closes #1464
This commit is contained in:
parent
e0bc2e5ffd
commit
121257c584
10 changed files with 27 additions and 27 deletions
10
src/parser.c
10
src/parser.c
|
@ -646,7 +646,7 @@ char* get_token_data_file_indexed(const char* token, const char* filename, int i
|
|||
goto out;
|
||||
}
|
||||
wtoken = utf8_to_wchar(token);
|
||||
if (wfilename == NULL) {
|
||||
if (wtoken == NULL) {
|
||||
uprintf(conversion_error, token);
|
||||
goto out;
|
||||
}
|
||||
|
@ -695,7 +695,7 @@ char* set_token_data_file(const char* token, const char* data, const char* filen
|
|||
goto out;
|
||||
}
|
||||
wtoken = utf8_to_wchar(token);
|
||||
if (wfilename == NULL) {
|
||||
if (wtoken == NULL) {
|
||||
uprintf(conversion_error, token);
|
||||
goto out;
|
||||
}
|
||||
|
@ -974,7 +974,7 @@ char* insert_section_data(const char* filename, const char* section, const char*
|
|||
goto out;
|
||||
}
|
||||
wsection = utf8_to_wchar(section);
|
||||
if (wfilename == NULL) {
|
||||
if (wsection == NULL) {
|
||||
uprintf(conversion_error, section);
|
||||
goto out;
|
||||
}
|
||||
|
@ -1110,7 +1110,7 @@ char* replace_in_token_data(const char* filename, const char* token, const char*
|
|||
goto out;
|
||||
}
|
||||
wtoken = utf8_to_wchar(token);
|
||||
if (wfilename == NULL) {
|
||||
if (wtoken == NULL) {
|
||||
uprintf(conversion_error, token);
|
||||
goto out;
|
||||
}
|
||||
|
@ -1120,7 +1120,7 @@ char* replace_in_token_data(const char* filename, const char* token, const char*
|
|||
goto out;
|
||||
}
|
||||
wrep = utf8_to_wchar(rep);
|
||||
if (wsrc == NULL) {
|
||||
if (wrep == NULL) {
|
||||
uprintf(conversion_error, rep);
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue