N
nroberts
Consider:
char const* f(char const* incoming)
{
static char buf[MAX];
strncpy(buf, incoming, strlen(incoming));
}
Is there ANY reason to use strncpy like that? I'm working on a
project that has such uses all throughout it and before I tell the
team leader that he's using a basic C function incorrectly I thought
I'd make sure I'm right.
char const* f(char const* incoming)
{
static char buf[MAX];
strncpy(buf, incoming, strlen(incoming));
}
Is there ANY reason to use strncpy like that? I'm working on a
project that has such uses all throughout it and before I tell the
team leader that he's using a basic C function incorrectly I thought
I'd make sure I'm right.