Commit e4271d87 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

advpack/tests: Fix string format warning.

parent 75b53222
...@@ -55,27 +55,20 @@ static BOOL is_spapi_err(DWORD err) ...@@ -55,27 +55,20 @@ static BOOL is_spapi_err(DWORD err)
return (((err & SPAPI_MASK) ^ SPAPI_PREFIX) == 0); return (((err & SPAPI_MASK) ^ SPAPI_PREFIX) == 0);
} }
static void append_str(char **str, const char *data)
{
sprintf(*str, data);
*str += strlen(*str);
}
static void create_inf_file(LPCSTR filename) static void create_inf_file(LPCSTR filename)
{ {
char data[1024];
char *ptr = data;
DWORD dwNumberOfBytesWritten; DWORD dwNumberOfBytesWritten;
HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
append_str(&ptr, "[Version]\n"); static const char data[] =
append_str(&ptr, "Signature=\"$Chicago$\"\n"); "[Version]\n"
append_str(&ptr, "AdvancedINF=2.5\n"); "Signature=\"$Chicago$\"\n"
append_str(&ptr, "[DefaultInstall]\n"); "AdvancedINF=2.5\n"
append_str(&ptr, "CheckAdminRights=1\n"); "[DefaultInstall]\n"
"CheckAdminRights=1\n";
WriteFile(hf, data, ptr - data, &dwNumberOfBytesWritten, NULL); WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL);
CloseHandle(hf); CloseHandle(hf);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment