diff --git a/docs/readme.en.md b/docs/readme.en.md index 7c56dd8d..2e07f1a3 100644 --- a/docs/readme.en.md +++ b/docs/readme.en.md @@ -442,7 +442,7 @@ When splitting all markers are resolved to absolute offsets. If a relative posit In `multisplit`or `multidisorder` case split is cancelled if no position remained. -`fakedsplit` и `fakeddisorder` use only one split position. It's searched from the `--dpi-desync-split-pos` list by a special alorightm. +`fakedsplit` и `fakeddisorder` use only one split position. It's searched from the `--dpi-desync-split-pos` list by a special algorithm. If split positions were loaded from `@file`, one position is randomly selected from that file list for each fake packet. First relative markers are searched. If no suitable found absolute markers are searched. If nothing found position 1 is used. diff --git a/nfq/nfqws.c b/nfq/nfqws.c index 281c4136..9c4dea98 100644 --- a/nfq/nfqws.c +++ b/nfq/nfqws.c @@ -1206,7 +1206,7 @@ static bool load_split_pos_file(const char *filename, struct proto_pos *splits, DLOG_PERROR("fopen split-pos file"); return false; } - char line[256], *p, *end; + char line[256], *p, *trim_pos; int line_num = 0; *split_count = 0; while (fgets(line, sizeof(line), f)) @@ -1221,8 +1221,8 @@ static bool load_split_pos_file(const char *filename, struct proto_pos *splits, if ((p = strchr(line, '\r'))) *p = 0; for (p = line; *p == ' ' || *p == '\t'; p++); if (!*p || *p == '#') continue; - end = p + strlen(p) - 1; - while (end > p && (*end == ' ' || *end == '\t')) *end-- = 0; + trim_pos = p + strlen(p) - 1; + while (trim_pos > p && (*trim_pos == ' ' || *trim_pos == '\t')) *trim_pos-- = 0; if (!parse_split_pos(p, splits + *split_count)) { DLOG_ERR("split-pos file %s line %d: invalid split pos: %s\n", filename, line_num, p);