Well, it isn't bad, but what's the point in multiple
set_xxxxxx(char *dst, char *src) functions?
Maybe it makes more sense to have a generic macro
which copies string into char[N] buffer, avoiding overflow.
Actually, there is similar code in your mail:
> -strncpy (current->comm, dev->name, sizeof(current->comm) - 1);
> -current->comm[sizeof(current->comm) - 1] = '\0';
> +set_current_title(dev->name);
A macro:
#define STRNCPY(dst,src) \
do { \
/* todo: put clever check that dst is char[] here */ \
strncpy((dst), (src), sizeof(dst)-1); \
dst[sizeof(dst)-1] = '\0'; \
} while(0)
-- vda - 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/