From: Jiaxing Wang Subject: regedit: Avoid appending '\' and '0' to string value of imported key. Message-Id: <1416468547-18928-1-git-send-email-hello.wjx@gmail.com> Date: Thu, 20 Nov 2014 15:29:07 +0800 After importing, string values are appended with '\' and '0'. For example, importing: [HKEY_LOCAL_MACHINE\testkey] "value"="abc" gets [HKEY_LOCAL_MACHINE\testkey] "value"="abc\0" This is because the null character after last quote is included which is not needed as the last quote has been changed to '\0' and dwLen already include the last quote. --- programs/regedit/regproc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 80beb21..643b559 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -376,7 +376,6 @@ static LONG setValue(WCHAR* val_name, WCHAR* val_data, BOOL is_unicode) return ERROR_INVALID_DATA; val_data[dwLen-1] = '\0'; /* remove last quotes */ lpbData = (BYTE*) val_data; - dwLen++; /* include terminating null */ dwLen = dwLen * sizeof(WCHAR); /* size is in bytes */ } else if (dwParseType == REG_DWORD) /* Convert the dword types */ -- 1.9.1