* strace.cc (strace::vsprntf): Fix potential (if unlikely) use of uninitialized

variable.
This commit is contained in:
Christopher Faylor 2013-12-22 07:07:48 +00:00
parent 57cfbb7bbf
commit 53b14dc2b1
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-12-22 Christopher Faylor <me.cygwin2013@cgf.cx>
* strace.cc (strace::vsprntf): Fix potential (if unlikely) use of
uninitialized variable.
2013-12-18 Christopher Faylor <me.cygwin2013@cgf.cx>
* dcrt0.cc (dll_crt0_1): Remove NtSetTimerResolution.

View File

@ -156,11 +156,12 @@ strace::vsprntf (char *buf, const char *func, const char *infmt, va_list ap)
else if (__progname)
sys_mbstowcs(pn = progname, NT_MAX_PATH, __progname);
WCHAR empty[1] = {};
PWCHAR p;
if (!pn)
GetModuleFileNameW (NULL, pn = progname, sizeof (progname));
if (!pn)
/* hmm */;
p = empty;
else if ((p = wcsrchr (pn, L'\\')) != NULL)
p++;
else if ((p = wcsrchr (pn, L'/')) != NULL)