strncpy()当我们将较少数量的数据复制到较大的(编译时分配的)缓冲区时,是否会导致内存泄漏?换句话说,内存利用不足会被称为内存泄漏吗?
以下是我的代码
#define uk "ln"
int main()
{
char buffer[32];
strncpy(buffer,uk,sizeof(buffer));// IS it memory leak free?
// uk macro has 3 byte of size to
// hold the string but here the
// Attemp of 32 byte is made to copy
// from uk macro to buffer?
}
Run Code Online (Sandbox Code Playgroud)
上面的代码中是否有内存泄漏或错误?