X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinpgnt.c;h=828747dac62a83bdb391f616d53c934bc510f730;hb=d23c0972cd850c77871f9a314e0520d7023c8b62;hp=b9addd196dac5a8cba3afc451256c649ebf92275;hpb=2bf868835591b39f17a157b1511b1e2f4b6e77da;p=PuTTY.git diff --git a/windows/winpgnt.c b/windows/winpgnt.c index b9addd19..828747da 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -349,22 +349,24 @@ static void keylist_update(void) } for (i = 0; NULL != (skey = index234(ssh2keys, i)); i++) { char *listentry, *p; - int fp_len; + int pos, fp_len; /* - * Replace two spaces in the fingerprint with tabs, for - * nice alignment in the box. + * Replace spaces with tabs in the fingerprint prefix, for + * nice alignment in the list box, until we encounter a : + * meaning we're into the fingerprint proper. */ p = skey->alg->fingerprint(skey->data); listentry = dupprintf("%s\t%s", p, skey->comment); fp_len = strlen(listentry); sfree(p); - p = strchr(listentry, ' '); - if (p && p < listentry + fp_len) - *p = '\t'; - p = strchr(listentry, ' '); - if (p && p < listentry + fp_len) - *p = '\t'; + pos = 0; + while (1) { + pos += strcspn(listentry + pos, " :"); + if (listentry[pos] == ':') + break; + listentry[pos++] = '\t'; + } SendDlgItemMessage(keylist, 100, LB_ADDSTRING, 0, (LPARAM) listentry); @@ -1514,7 +1516,7 @@ static int CALLBACK KeyListProc(HWND hwnd, UINT msg, keylist = hwnd; { - static int tabs[] = { 35, 60, 210 }; + static int tabs[] = { 35, 75, 250 }; SendDlgItemMessage(hwnd, 100, LB_SETTABSTOPS, sizeof(tabs) / sizeof(*tabs), (LPARAM) tabs);