Gerald Pfeifer : programs/regedit: Fix format specifiers for _stscanf and fprintf.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 10 06:50:54 CDT 2006


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

Author: Gerald Pfeifer <pfeifer at dbai.tuwien.ac.at>
Date:   Mon Oct  9 18:38:30 2006 +0200

programs/regedit: Fix format specifiers for _stscanf and fprintf.

---

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

diff --git a/programs/regedit/edit.c b/programs/regedit/edit.c
index 9b1cf27..e71a247 100644
--- a/programs/regedit/edit.c
+++ b/programs/regedit/edit.c
@@ -107,7 +107,7 @@ static BOOL change_dword_base(HWND hwndD
     DWORD val;
 
     if (!GetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf, COUNT_OF(buf))) return FALSE;
-    if (!_stscanf(buf, toHex ? "%ld" : "%lx", &val)) return FALSE;
+    if (!_stscanf(buf, toHex ? "%d" : "%x", &val)) return FALSE;
     wsprintf(buf, toHex ? "%lx" : "%ld", val);
     return SetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf);    
 }
@@ -308,7 +308,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoo
 	wsprintf(stringValueData, isDecimal ? "%ld" : "%lx", *((DWORD*)stringValueData));
 	if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK) {
 	    DWORD val;
-	    if (_stscanf(stringValueData, isDecimal ? "%ld" : "%lx", &val)) {
+	    if (_stscanf(stringValueData, isDecimal ? "%d" : "%x", &val)) {
 		lRet = RegSetValueEx(hKey, valueName, 0, type, (BYTE*)&val, sizeof(val));
 		if (lRet == ERROR_SUCCESS) result = TRUE;
 		else error_code_messagebox(hwnd, lRet);
diff --git a/programs/regedit/regedit.c b/programs/regedit/regedit.c
index 62558be..1ede60f 100644
--- a/programs/regedit/regedit.c
+++ b/programs/regedit/regedit.c
@@ -177,7 +177,7 @@ BOOL PerformRegAction(REGEDIT_ACTION act
                 }
                 if (size==0)
                 {
-                    fprintf(stderr,"%s: File not found \"%s\" (%ld)\n",
+                    fprintf(stderr,"%s: File not found \"%s\" (%d)\n",
                             getAppName(),filename,GetLastError());
                     exit(1);
                 }




More information about the wine-cvs mailing list