And both implementations suffer from the fact that if tsk->comm
were to change from a fixed length array to a char*, allowing
arbitrarily sized names, you would end up copying very little
indeed. :) What not something more general like:
char * safe_strncpy(char *dst, const char *src, size_t size)
{
dst[size-1] = '\0';
strncpy(dst, src, size-1);
}
-Erik
-- Erik B. Andersen http://codepoet-consulting.com/ --This message was written using 73% post-consumer electrons-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/