Skip to content

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

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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