Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unsigned char for the bzip2 input buffer #316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions toys/other/bzcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct bwdata {
struct bunzip_data {
// Input stream, input buffer, input bit buffer
int in_fd, inbufCount, inbufPos;
char *inbuf;
unsigned char *inbuf;
unsigned int inbufBitCount, inbufBits;

// Output buffer
Expand Down Expand Up @@ -601,7 +601,7 @@ static int write_bunzip_data(struct bunzip_data *bd, struct bwdata *bw,

// Allocate the structure, read file header. If !len, src_fd contains
// filehandle to read from. Else inbuf contains data.
static int start_bunzip(struct bunzip_data **bdp, int src_fd, char *inbuf,
static int start_bunzip(struct bunzip_data **bdp, int src_fd, unsigned char *inbuf,
int len)
{
struct bunzip_data *bd;
Expand All @@ -618,7 +618,7 @@ static int start_bunzip(struct bunzip_data **bdp, int src_fd, char *inbuf,
bd->inbufCount = len;
bd->in_fd = -1;
} else {
bd->inbuf = (char *)(bd+1);
bd->inbuf = (unsigned char *)(bd+1);
bd->in_fd = src_fd;
}

Expand Down