Got rid of the strlen() call in comctl32_windows.c. Thanks to joeshow on the Gopher Academy Slack.

This commit is contained in:
Pietro Gagliardi 2014-08-12 15:58:17 -04:00
parent f27aa8df46
commit d060977cc7
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ DWORD initCommonControls(char **errmsg)
*errmsg = "error creating manifest file";
return GetLastError();
}
nExpected = strlen(manifest); /* TODO make static */
nExpected = (sizeof manifest / sizeof manifest[0]) - 1; /* - 1 to omit the terminating null character)
SetLastError(0); /* catch errorless short writes */
if (WriteFile(file, manifest, nExpected, &nGot, NULL) == 0) {
*errmsg = "error writing manifest file";