From 16756d7e2bb5b1d8e59a56e645741882c4a345f2 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 20 Apr 1997 06:35:15 +0000 Subject: [PATCH] reformat and fix git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1605 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/passwd_dlg.c | 65 ++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 30 deletions(-) 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 */