X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=pageant.c;h=2d0b15eee6f2c87e303a9b76f65e750edcc1c527;hb=713679a0fa85d0b92c3fa74a6c8dc015f4d800c6;hp=6f942625fbfc0286590ae31386550f25e405e300;hpb=1c998f64827fe97296b3a422173ba9d7c03661e6;p=PuTTY.git diff --git a/pageant.c b/pageant.c index 6f942625..2d0b15ee 100644 --- a/pageant.c +++ b/pageant.c @@ -170,7 +170,7 @@ static int CALLBACK AboutProc (HWND hwnd, UINT msg, */ static int CALLBACK PassphraseProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - static char *passphrase; + static char *passphrase = NULL; struct PassphraseProcStruct *p; switch (msg) { @@ -197,6 +197,7 @@ static int CALLBACK PassphraseProc(HWND hwnd, UINT msg, if (p->comment) SetDlgItemText(hwnd, 101, p->comment); *passphrase = 0; + SetDlgItemText (hwnd, 102, passphrase); return 0; case WM_COMMAND: switch (LOWORD(wParam)) { @@ -210,7 +211,7 @@ static int CALLBACK PassphraseProc(HWND hwnd, UINT msg, EndDialog (hwnd, 0); return 0; case 102: /* edit box */ - if (HIWORD(wParam) == EN_CHANGE) { + if ((HIWORD(wParam) == EN_CHANGE) && passphrase) { GetDlgItemText (hwnd, 102, passphrase, PASSPHRASE_MAXLEN-1); passphrase[PASSPHRASE_MAXLEN-1] = '\0'; }