programs/regedit: Fix format specifiers for _stscanf and fprintf.
This commit is contained in:
parent
82379f22a7
commit
cc5e910658
|
@ -107,7 +107,7 @@ static BOOL change_dword_base(HWND hwndDlg, BOOL toHex)
|
||||||
DWORD val;
|
DWORD val;
|
||||||
|
|
||||||
if (!GetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf, COUNT_OF(buf))) return FALSE;
|
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);
|
wsprintf(buf, toHex ? "%lx" : "%ld", val);
|
||||||
return SetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf);
|
return SetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf);
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPCTSTR valueName)
|
||||||
wsprintf(stringValueData, isDecimal ? "%ld" : "%lx", *((DWORD*)stringValueData));
|
wsprintf(stringValueData, isDecimal ? "%ld" : "%lx", *((DWORD*)stringValueData));
|
||||||
if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK) {
|
if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK) {
|
||||||
DWORD val;
|
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));
|
lRet = RegSetValueEx(hKey, valueName, 0, type, (BYTE*)&val, sizeof(val));
|
||||||
if (lRet == ERROR_SUCCESS) result = TRUE;
|
if (lRet == ERROR_SUCCESS) result = TRUE;
|
||||||
else error_code_messagebox(hwnd, lRet);
|
else error_code_messagebox(hwnd, lRet);
|
||||||
|
|
|
@ -177,7 +177,7 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
|
||||||
}
|
}
|
||||||
if (size==0)
|
if (size==0)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"%s: File not found \"%s\" (%ld)\n",
|
fprintf(stderr,"%s: File not found \"%s\" (%d)\n",
|
||||||
getAppName(),filename,GetLastError());
|
getAppName(),filename,GetLastError());
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue