From d060977cc7644be37774192f0015ce1e6a91b2aa Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 12 Aug 2014 15:58:17 -0400 Subject: [PATCH] Got rid of the strlen() call in comctl32_windows.c. Thanks to joeshow on the Gopher Academy Slack. --- redo/comctl32_windows.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redo/comctl32_windows.c b/redo/comctl32_windows.c index df1bdcd..244573d 100644 --- a/redo/comctl32_windows.c +++ b/redo/comctl32_windows.c @@ -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";