diff --git a/lib/des/passwd_dlg.c b/lib/des/passwd_dlg.c index ea270f58e..8257495bc 100644 --- a/lib/des/passwd_dlg.c +++ b/lib/des/passwd_dlg.c @@ -41,6 +41,11 @@ * Date: June 1996 */ +#ifdef HAVE_CONFIG_H +#include +RCSID("$Id$"); +#endif + #ifdef WIN32 /* Visual C++ 4.0 (Windows95/NT) */ #include #include "passwd_dlg.h" @@ -49,44 +54,44 @@ char passwd[passwdBufSZ]; -BOOL CALLBACK pwd_dialog_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +BOOL CALLBACK +pwd_dialog_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - switch(uMsg) + switch(uMsg) + { + case WM_COMMAND: + switch(wParam) { - case WM_COMMAND: - switch(wParam) - { - case IDOK: - if(!GetDlgItemText(hwndDlg,IDC_PASSWD_EDIT, passwd ,passwdBufSZ)) - EndDialog(hwndDlg, IDCANCEL); - case IDCANCEL: - EndDialog(hwndDlg, wParam); - return TRUE; - } + case IDOK: + if(!GetDlgItemText(hwndDlg,IDC_PASSWD_EDIT, passwd, passwdBufSZ)) + EndDialog(hwndDlg, IDCANCEL); + case IDCANCEL: + EndDialog(hwndDlg, wParam); + return TRUE; } - return FALSE; + } + return FALSE; } /* return 0 if ok, 1 otherwise */ -int pwd_dialog(char *buf, int size) +int +pwd_dialog(char *buf, int size) { - int i; - HWND wnd = GetActiveWindow(); - HANDLE hInst = GetModuleHandle("des"); - switch(DialogBox(hInst,MAKEINTRESOURCE(IDD_PASSWD_DIALOG),wnd,pwd_dialog_proc)) - { - case IDOK: - strcpy(buf,passwd); - for(i=0; passwd[i] != '\0'; i++) passwd[i] = '\0'; - return 0; - case IDCANCEL: - default: - for(i=0; passwd[i] != '\0'; i++) passwd[i] = '\0'; - return 1; - } + int i; + HWND wnd = GetActiveWindow(); + HANDLE hInst = GetModuleHandle("des"); + switch(DialogBox(hInst,MAKEINTRESOURCE(IDD_PASSWD_DIALOG),wnd,pwd_dialog_proc)) + { + case IDOK: + strcpy(buf,passwd); + for(i=0; passwd[i] != '\0'; i++) passwd[i] = '\0'; + return 0; + case IDCANCEL: + default: + for(i=0; passwd[i] != '\0'; i++) passwd[i] = '\0'; + return 1; + } } - - #endif /* WIN32 */