Skip to content

Instantly share code, notes, and snippets.

@davidreynolds
Created June 30, 2012 20:30
Show Gist options
  • Save davidreynolds/3025393 to your computer and use it in GitHub Desktop.
Save davidreynolds/3025393 to your computer and use it in GitHub Desktop.
void encode(void)
{
...
while (r < bufferend) {
...
r += y; s += y;
if (r >= N * 2 - F) {
for (i = 0; i < N; i++) buffer[i] = buffer[i + N];
bufferend -= N; r -= N; s -= N;
while (bufferend < N * 2) {
if ((c = fgetc(infile)) == EOF) break;
buffer[bufferend++] = c; textcount++;
}
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment