Hello Damjan,
On 8/3/19 10:24 PM, Damjan Jovanovic wrote:
int wmain (int argc, WCHAR *argv[]) { SHELLEXECUTEINFOW sei; @@ -223,7 +242,13 @@ int wmain (int argc, WCHAR *argv[]) for (i=1; i<argc; i++) { /* parse first quoted argument as console title */ if (!title && argv[i][0] == '"') {
title = argv[i];
/* it will remove at least 1 quote */
int maxChars = lstrlenW(argv[1]);
title = HeapAlloc(GetProcessHeap(), 0, maxChars*sizeof(WCHAR));
if (title)
parse_title(argv[i], title, maxChars);
else
} if (argv[i][0] != '/')fatal_string(STRING_NOMEMFORTITLE); continue;
Is this really salient enough to warrant error handling? I wouldn't particularly imagine we're likely to run out of memory here.
If so, perhaps we should use FormatMessage() instead of introducing a new string resource.