4 ms·
But you don't want to use strncpy, especially not inside the kernel - since it may waste a lot of useless cpu. char big_enough[512]; strncpy(big_enough
by noselasd 4y ago
But you don't want to use strncpy, especially not inside the kernel - since it may waste a lot of useless cpu.
char big_enough[512];
strncpy(big_enough, sizeof 512, small_string];
strncpy now fills the rest of big_enough with nuls, a lot of waste if small_string is 4 characters long.