bug 688877 - fix some usage of GetDlgItemText in Windows crashreporter. r=ehsan
authorTed Mielczarek <ted.mielczarek@gmail.com>
Mon, 26 Sep 2011 14:40:09 -0400
changeset 77605 f0630e6aac18421115a21bc1f64edbdded012b96
parent 77604 66736ca9c8c381f7bf9e2a8b67bb492c1b55398e
child 77606 a2f97b48ed3e7f9f82b83aa845863d3016d264aa
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersehsan
bugs688877
milestone9.0a1
bug 688877 - fix some usage of GetDlgItemText in Windows crashreporter. r=ehsan
toolkit/crashreporter/client/crashreporter_win.cpp
--- a/toolkit/crashreporter/client/crashreporter_win.cpp
+++ b/toolkit/crashreporter/client/crashreporter_win.cpp
@@ -442,17 +442,18 @@ static DWORD WINAPI SendThreadProc(LPVOI
 
   return 0;
 }
 
 static void EndCrashReporterDialog(HWND hwndDlg, int code)
 {
   // Save the current values to the registry
   wchar_t email[MAX_EMAIL_LENGTH];
-  GetDlgItemText(hwndDlg, IDC_EMAILTEXT, email, sizeof(email));
+  GetDlgItemTextW(hwndDlg, IDC_EMAILTEXT, email,
+                  sizeof(email) / sizeof(email[0]));
   SetStringKey(gCrashReporterKey.c_str(), EMAIL_VALUE, email);
 
   SetBoolKey(gCrashReporterKey.c_str(), INCLUDE_URL_VALUE,
              IsDlgButtonChecked(hwndDlg, IDC_INCLUDEURLCHECK) != 0);
   SetBoolKey(gCrashReporterKey.c_str(), EMAIL_ME_VALUE,
              IsDlgButtonChecked(hwndDlg, IDC_EMAILMECHECK) != 0);
   SetBoolKey(gCrashReporterKey.c_str(), SUBMIT_REPORT_VALUE,
              IsDlgButtonChecked(hwndDlg, IDC_SUBMITREPORTCHECK) != 0);
@@ -585,30 +586,32 @@ static void UpdateURL(HWND hwndDlg)
     gQueryParameters.erase(L"URL");
   }
 }
 
 static void UpdateEmail(HWND hwndDlg)
 {
   if (IsDlgButtonChecked(hwndDlg, IDC_EMAILMECHECK)) {
     wchar_t email[MAX_EMAIL_LENGTH];
-    GetDlgItemText(hwndDlg, IDC_EMAILTEXT, email, sizeof(email));
+    GetDlgItemTextW(hwndDlg, IDC_EMAILTEXT, email,
+                    sizeof(email) / sizeof(email[0]));
     gQueryParameters[L"Email"] = email;
     if (IsDlgButtonChecked(hwndDlg, IDC_SUBMITREPORTCHECK))
       EnableWindow(GetDlgItem(hwndDlg, IDC_EMAILTEXT), true);
   } else {
     gQueryParameters.erase(L"Email");
     EnableWindow(GetDlgItem(hwndDlg, IDC_EMAILTEXT), false);
   }
 }
 
 static void UpdateComment(HWND hwndDlg)
 {
   wchar_t comment[MAX_COMMENT_LENGTH + 1];
-  GetDlgItemText(hwndDlg, IDC_COMMENTTEXT, comment, sizeof(comment));
+  GetDlgItemTextW(hwndDlg, IDC_COMMENTTEXT, comment,
+                  sizeof(comment) / sizeof(comment[0]));
   if (wcslen(comment) > 0)
     gQueryParameters[L"Comments"] = comment;
   else
     gQueryParameters.erase(L"Comments");
 }
 
 /*
  * Dialog procedure for the "view report" dialog.