Thanks to visit codestin.com
Credit goes to github.com

Skip to content

probable error in unix version: numItems ignored in readCallBack #9

@GrahamAsher

Description

@GrahamAsher

In the following code the argument numItems is ignored. In contrast, in the function writeCallback immediately following, it is multiplied by size.

naett/naett.c

Lines 836 to 840 in e44a499

static size_t readCallback(char* buffer, size_t size, size_t numItems, void* userData) {
InternalResponse* res = (InternalResponse*)userData;
InternalRequest* req = res->request;
return req->options.bodyReader(buffer, size, req->options.bodyReaderData);
}

Fix: replace line 839 with

return req->options.bodyReader(buffer, size * numItems, req->options.bodyReaderData);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions