Bugzilla – Attachment 2445 Details for
Bug 2247
[visual host key] fix upper border display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
committed patch
art.diff (text/plain), 1.36 KB, created by
Damien Miller
on 2014-07-03 11:46:44 AEST
(
hide
)
Description:
committed patch
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2014-07-03 11:46:44 AEST
Size:
1.36 KB
patch
obsolete
>diff --git sshkey.c sshkey.c >index 1648b7e..f5e4d20 100644 >--- sshkey.c >+++ sshkey.c >@@ -1002,11 +1002,11 @@ fingerprint_randomart(u_char *dgst_raw, size_t dgst_raw_len, > * intersects with itself. Matter of taste. > */ > char *augmentation_string = " .o+=*BOX@%&#/^SE"; >- char *retval, *p; >+ char *retval, *p, title[FLDSIZE_X]; > u_char field[FLDSIZE_X][FLDSIZE_Y]; >- size_t i; >+ size_t i, tlen; > u_int b; >- int x, y; >+ int x, y, r; > size_t len = strlen(augmentation_string) - 1; > > if ((retval = calloc((FLDSIZE_X + 3), (FLDSIZE_Y + 2))) == NULL) >@@ -1044,12 +1044,21 @@ fingerprint_randomart(u_char *dgst_raw, size_t dgst_raw_len, > field[FLDSIZE_X / 2][FLDSIZE_Y / 2] = len - 1; > field[x][y] = len; > >- /* fill in retval */ >- snprintf(retval, FLDSIZE_X, "+--[%4s %4u]", >- sshkey_type(k), sshkey_size(k)); >- p = strchr(retval, '\0'); >+ /* assemble title */ >+ r = snprintf(title, sizeof(title), "[%s %u]", >+ sshkey_type(k), sshkey_size(k)); >+ /* If [type size] won't fit, then try [type]; fits "[ED25519-CERT]" */ >+ if (r < 0 || r > (int)sizeof(title)) >+ snprintf(title, sizeof(title), "[%s]", sshkey_type(k)); >+ tlen = strlen(title); > > /* output upper border */ >+ p = retval; >+ *p++ = '+'; >+ for (i = 0; i < (FLDSIZE_X - tlen) / 2; i++) >+ *p++ = '-'; >+ memcpy(p, title, tlen); >+ p += tlen; > for (i = p - retval - 1; i < FLDSIZE_X; i++) > *p++ = '-'; > *p++ = '+';
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2247
:
2442
|
2443
|
2444
| 2445