[misc] add static_strcat & static_strcpy and use static_ calls wherever possible

* Also set Rufus next to 2.17 and fix a warning
This commit is contained in:
Pete Batard 2017-08-10 19:43:04 +01:00
parent 5d371088cb
commit 90dc847e24
23 changed files with 121 additions and 120 deletions

View file

@ -151,7 +151,7 @@ static char err_string[256] = {0};
error_code = GetLastError();
safe_sprintf(err_string, sizeof(err_string), "[0x%08lX] ", error_code);
static_sprintf(err_string, "[0x%08lX] ", error_code);
size = FormatMessageU(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, HRESULT_CODE(error_code),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &err_string[strlen(err_string)],
@ -159,10 +159,10 @@ static char err_string[256] = {0};
if (size == 0) {
format_error = GetLastError();
if ((format_error) && (format_error != 0x13D)) // 0x13D, decode error, is returned for unknown codes
safe_sprintf(err_string, sizeof(err_string),
"Windows error code 0x%08lX (FormatMessage error code 0x%08lX)", error_code, format_error);
static_sprintf(err_string, "Windows error code 0x%08lX (FormatMessage error code 0x%08lX)",
error_code, format_error);
else
safe_sprintf(err_string, sizeof(err_string), "Unknown error 0x%08lX", error_code);
static_sprintf(err_string, "Unknown error 0x%08lX", error_code);
}
SetLastError(error_code); // Make sure we don't change the errorcode on exit