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

the function _vsnprintf_output returns bad count. #153

Open
mazhenke opened this issue Aug 17, 2016 · 0 comments
Open

the function _vsnprintf_output returns bad count. #153

mazhenke opened this issue Aug 17, 2016 · 0 comments

Comments

@mazhenke
Copy link

mazhenke commented Aug 17, 2016

in function _vsnprintf_output from:lib/libc/printf.c

static int _vsnprintf_output(const char *str, size_t len, void *state)
{
struct _output_args *args = state;

size_t count = 0;
while (count < len) {
    if (args->pos < args->len) {
        args->outstr[args->pos++] = *str;
    }

    str++;
    count++;
}

return count;

}

the return value count couldn't represent the actual length of string const char *str.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant