sshpubk.c (putty-0.75) | : | sshpubk.c (putty-0.76) | ||
---|---|---|---|---|
skipping to change at line 483 | skipping to change at line 483 | |||
* the "PPK file format" appendix in the PuTTY manual. | * the "PPK file format" appendix in the PuTTY manual. | |||
*/ | */ | |||
static bool read_header(BinarySource *src, char *header) | static bool read_header(BinarySource *src, char *header) | |||
{ | { | |||
int len = 39; | int len = 39; | |||
int c; | int c; | |||
while (1) { | while (1) { | |||
c = get_byte(src); | c = get_byte(src); | |||
if (c == '\n' || c == '\r' || c == EOF) | if (c == '\n' || c == '\r' || get_err(src)) | |||
return false; /* failure */ | return false; /* failure */ | |||
if (c == ':') { | if (c == ':') { | |||
c = get_byte(src); | c = get_byte(src); | |||
if (c != ' ') | if (c != ' ') | |||
return false; | return false; | |||
*header = '\0'; | *header = '\0'; | |||
return true; /* success! */ | return true; /* success! */ | |||
} | } | |||
if (len == 0) | if (len == 0) | |||
return false; /* failure */ | return false; /* failure */ | |||
skipping to change at line 506 | skipping to change at line 506 | |||
} | } | |||
return false; /* failure */ | return false; /* failure */ | |||
} | } | |||
static char *read_body(BinarySource *src) | static char *read_body(BinarySource *src) | |||
{ | { | |||
strbuf *buf = strbuf_new_nm(); | strbuf *buf = strbuf_new_nm(); | |||
while (1) { | while (1) { | |||
int c = get_byte(src); | int c = get_byte(src); | |||
if (c == '\r' || c == '\n' || c == EOF) { | if (c == '\r' || c == '\n' || get_err(src)) { | |||
if (c != EOF) { | if (!get_err(src)) { | |||
c = get_byte(src); | c = get_byte(src); | |||
if (c != '\r' && c != '\n') | if (c != '\r' && c != '\n' && !get_err(src)) | |||
src->pos--; | src->pos--; | |||
} | } | |||
return strbuf_to_str(buf); | return strbuf_to_str(buf); | |||
} | } | |||
put_byte(buf, c); | put_byte(buf, c); | |||
} | } | |||
} | } | |||
static bool read_blob(BinarySource *src, int nlines, BinarySink *bs) | static bool read_blob(BinarySource *src, int nlines, BinarySink *bs) | |||
{ | { | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added |