Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Michael A. (Mike) Iovine
p1
Commits
ea230a0f
Commit
ea230a0f
authored
5 years ago
by
John M. (Jack) Maxfield
Browse files
Options
Download
Email Patches
Plain Diff
Make sure length <= 258
parent
21d2d56e
master
No related merge requests found
Pipeline
#30574
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lz77/lz77.c
+1
-1
lz77/lz77.c
with
1 addition
and
1 deletion
+1
-1
lz77/lz77.c
View file @
ea230a0f
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help