Ted Percival : regedit: Interpret REG_DWORD as unsigned in editor.

Alexandre Julliard julliard at winehq.org
Mon Jun 23 07:35:31 CDT 2008


Module: wine
Branch: master
Commit: 0674e619550909cf1e2d3aa492c3ddbedd2abd64
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0674e619550909cf1e2d3aa492c3ddbedd2abd64

Author: Ted Percival <ted at midg3t.net>
Date:   Sat Jun 21 22:30:33 2008 +1000

regedit: Interpret REG_DWORD as unsigned in editor.

---

 programs/regedit/edit.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/programs/regedit/edit.c b/programs/regedit/edit.c
index 40a0834..5135dea 100644
--- a/programs/regedit/edit.c
+++ b/programs/regedit/edit.c
@@ -107,8 +107,8 @@ static BOOL change_dword_base(HWND hwndDlg, BOOL toHex)
     DWORD val;
 
     if (!GetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf, COUNT_OF(buf))) return FALSE;
-    if (!_stscanf(buf, toHex ? "%d" : "%x", &val)) return FALSE;
-    wsprintf(buf, toHex ? "%lx" : "%ld", val);
+    if (!_stscanf(buf, toHex ? "%u" : "%x", &val)) return FALSE;
+    wsprintf(buf, toHex ? "%x" : "%u", val);
     return SetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf);    
 }
 
@@ -305,10 +305,10 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPCTSTR valueName)
             else error_code_messagebox(hwnd, lRet);
         }
     } else if ( type == REG_DWORD ) {
-	wsprintf(stringValueData, isDecimal ? "%ld" : "%lx", *((DWORD*)stringValueData));
+	wsprintf(stringValueData, isDecimal ? "%u" : "%x", *((DWORD*)stringValueData));
 	if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK) {
 	    DWORD val;
-	    if (_stscanf(stringValueData, isDecimal ? "%d" : "%x", &val)) {
+	    if (_stscanf(stringValueData, isDecimal ? "%u" : "%x", &val)) {
 		lRet = RegSetValueEx(hKey, valueName, 0, type, (BYTE*)&val, sizeof(val));
 		if (lRet == ERROR_SUCCESS) result = TRUE;
 		else error_code_messagebox(hwnd, lRet);




More information about the wine-cvs mailing list