Skip to content

In UB ex3 - using strncpy is considered unsafe (produces warnings and even fails compilation in some compilers) #5

@feature-engineer

Description

@feature-engineer

Use strncpy_s(buf.data(), buf.size(), input, strlen(input)); (or at least mention this).
In this instance, since you want to try to copy the whole input, it's simpler to call strcpy_s(buf.data(), buf.size(), input);

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