Olaf van der Spek wrote: > On Thu, Feb 10, 2011 at 12:08 PM, Thomas Bellman <bell...@nsc.liu.se> > wrote: >> strncpy(args.name, source, BTRFS_PATH_NAME_MAX); >> args.name[BTRFS_PATH_NAME_MAX] = '\0'; > > That's silly. Isn't there a sane safe variant of strcpy?
There's strlcpy, but it's not in glibc because of possible truncation errors! http://en.wikipedia.org/wiki/Strlcpy Of course C++ strings would be much better... :-) Jeremy -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html