New upstream version 22.0.3+dfsg1

This commit is contained in:
Sebastian Ramacher 2018-12-16 17:14:58 +01:00
parent 665f64a933
commit cdc9a9fc87
334 changed files with 14525 additions and 2639 deletions

View file

@ -404,7 +404,7 @@ void load_text_from_file(struct ft2_source *srcdata, const char *filename)
void read_from_end(struct ft2_source *srcdata, const char *filename)
{
FILE *tmp_file = NULL;
uint32_t filesize = 0, cur_pos = 0;
uint32_t filesize = 0, cur_pos = 0, log_lines = 0;
char *tmp_read = NULL;
uint16_t value = 0, line_breaks = 0;
size_t bytes_read;
@ -428,8 +428,9 @@ void read_from_end(struct ft2_source *srcdata, const char *filename)
fseek(tmp_file, 0, SEEK_END);
filesize = (uint32_t)ftell(tmp_file);
cur_pos = filesize;
log_lines = srcdata->log_lines;
while (line_breaks <= 6 && cur_pos != 0) {
while (line_breaks <= log_lines && cur_pos != 0) {
if (!utf16) cur_pos--;
else cur_pos -= 2;
fseek(tmp_file, cur_pos, SEEK_SET);