regedit: Fix editing and exporting of zero-size strings.
This commit is contained in:
parent
520d1bc5e4
commit
e568580447
|
@ -224,7 +224,7 @@ static LPTSTR read_value(HWND hwnd, HKEY hKey, LPCTSTR valueName, DWORD *lpType,
|
|||
goto done;
|
||||
}
|
||||
if ( *lpType == REG_DWORD ) valueDataLen = sizeof(DWORD);
|
||||
if (!(buffer = HeapAlloc(GetProcessHeap(), 0, valueDataLen))) {
|
||||
if (!(buffer = HeapAlloc(GetProcessHeap(), 0, valueDataLen+1))) {
|
||||
error(hwnd, IDS_TOO_BIG_VALUE, valueDataLen);
|
||||
goto done;
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ static LPTSTR read_value(HWND hwnd, HKEY hKey, LPCTSTR valueName, DWORD *lpType,
|
|||
error(hwnd, IDS_BAD_VALUE, valueName);
|
||||
goto done;
|
||||
}
|
||||
|
||||
buffer[valueDataLen] = 0;
|
||||
if(len) *len = valueDataLen;
|
||||
return buffer;
|
||||
|
||||
|
|
|
@ -764,7 +764,7 @@ static void export_hkey(FILE *file, HKEY key,
|
|||
case REG_SZ:
|
||||
case REG_EXPAND_SZ:
|
||||
fputs("\"", file);
|
||||
REGPROC_export_string(file, (char*) *val_buf);
|
||||
if (val_size1) REGPROC_export_string(file, (char*) *val_buf);
|
||||
fputs("\"\n", file);
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue