From 407409f27f40202274a8177862bb80bd1c1c0723 Mon Sep 17 00:00:00 2001 From: Peter Berg Larsen Date: Mon, 18 Apr 2005 15:36:59 +0000 Subject: [PATCH] Remove 2 identicals calls to strlenW. --- dlls/msi/format.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/msi/format.c b/dlls/msi/format.c index 3faa18a24db..d8d78827e46 100644 --- a/dlls/msi/format.c +++ b/dlls/msi/format.c @@ -358,11 +358,12 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, value = deformat_index(record,key,&chunk); else { - chunk = (strlenW(key) + 2)*sizeof(WCHAR); + DWORD keylen = strlenW(key); + chunk = (keylen + 2)*sizeof(WCHAR); value = HeapAlloc(GetProcessHeap(),0,chunk); value[0] = '['; - memcpy(&value[1],key,strlenW(key)*sizeof(WCHAR)); - value[strlenW(key)+1] = ']'; + memcpy(&value[1],key,keylen*sizeof(WCHAR)); + value[1+keylen] = ']'; } } else