Commit ea230a0f authored by John M. (Jack) Maxfield's avatar John M. (Jack) Maxfield
Browse files

Make sure length <= 258

parent 21d2d56e
No related merge requests found
Pipeline #30574 canceled with stage
Showing with 1 addition and 1 deletion
+1 -1
......@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
size_t dif = 0;
size_t dist = cursor - pos->value;
/* take mod to account for case when length longer than distance */
while (cursor + dif < input_file_length && inp[cursor + dif] == inp[pos->value + dif % dist]) dif += 1;
while (cursor + dif < input_file_length && inp[cursor + dif] == inp[pos->value + dif % dist] && dif < 258) dif += 1;
assert(dif >= 3);
if (dif > best_len)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment