Module: wine Branch: master Commit: eeeca57072f87d3796a030fba1d690915da6ebc5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=eeeca57072f87d3796a030fba1...
Author: Vincent Povirk vincent@codeweavers.com Date: Tue Jul 19 13:22:07 2011 -0500
shell32: Include NULL terminators in the lengths used by SHELL_ArgifyW.
---
dlls/shell32/shlexec.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index ff07550..7bbbb2b 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -269,7 +269,12 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp } }
- *res = '\0'; + used ++; + if (res - out < len) + *res = '\0'; + else + out[len-1] = '\0'; + TRACE("used %i of %i space\n",used,len); if (out_len) *out_len = used;