1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-26 02:46:13 -04:00

[gopher] Nothing is easy as it seems. Refs #34

This commit is contained in:
Witold Filipczyk 2019-05-13 12:46:44 +02:00
parent 12b270e8d2
commit e4b536f8ab

View File

@ -567,7 +567,7 @@ add_gopher_menu_line(struct string *buffer, unsigned char *line)
static unsigned char *
get_gopher_line_end(unsigned char *data, int datalen)
{
for (; datalen > 1; data++, datalen--) {
for (; datalen >= 1; data++, datalen--) {
if (data[0] == ASCII_CR && data[1] == ASCII_LF)
return data + 2;
@ -583,9 +583,6 @@ check_gopher_last_line(unsigned char *line, unsigned char *end)
{
assert(line < end);
/* Just to be safe NUL terminate the line */
end[-2] = 0;
return line[0] == '.' && !line[1] ? NULL : line;
}