> You can use strncpy if you are careful to do it right
That’s like saying if you’re careful to do it right you can use a Bowie knife as a screwdriver.
Technically correct but practically will end in tears. If you’re not working with fixed-size strings (which few are these days) just copy over strscpy, or strlcpy, 5 lines won’t kill you.
That’s like saying if you’re careful to do it right you can use a Bowie knife as a screwdriver.
Technically correct but practically will end in tears. If you’re not working with fixed-size strings (which few are these days) just copy over strscpy, or strlcpy, 5 lines won’t kill you.