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

replace 4194304 with READ_BLOCK_SIZE #2539

Merged
merged 1 commit into from
Oct 28, 2022
Merged
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
4 changes: 2 additions & 2 deletions libdispatch/dutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ NC_readfileF(FILE* stream, NCbytes* content, long long amount)
#define READ_BLOCK_SIZE 4194304
int ret = NC_NOERR;
long long red = 0;
char *part = (char*) malloc(4194304);
char *part = (char*) malloc(READ_BLOCK_SIZE);

while(amount < 0 || red < amount) {
size_t count = fread(part, 1, 4194304, stream);
size_t count = fread(part, 1, READ_BLOCK_SIZE, stream);
if(ferror(stream)) {ret = NC_EIO; goto done;}
if(count > 0) ncbytesappendn(content,part,(unsigned long)count);
red += count;
Expand Down