On Mon, 27 Sep 2010 at 14:06:45 +0200, Tamas TEVESZ wrote: > > > Perhaps we should just copy this into wmaker and use it without > > even bothering to check for bsd libs and stuff? I think it would > > be simpler and it would avoid some #ifdefs etc. > > do they have a matching strlcat? if not, i definitely don't want to > mix them; if yes, maybe.
Yes, they do. See http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=lib/string.c;h=f71bead1be3efaf5694cbbe1df1d59edb18b74ae;hb=HEAD /** * strlcat - Append a length-limited, %NUL-terminated string to another * @dest: The string to be appended to * @src: The string to append to it * @count: The size of the destination buffer. */ size_t strlcat(char *dest, const char *src, size_t count) { size_t dsize = strlen(dest); size_t len = strlen(src); size_t res = dsize + len; /* This would be a bug */ BUG_ON(dsize >= count); dest += dsize; count -= dsize; if (len >= count) len = count-1; memcpy(dest, src, len); dest[len] = 0; return res; } of course, one would need to replace the BUG_ON() macro. > all in all, i feel more comfortable with the bsd versions. I can read the linux version better, and it looks simple enough to just have it compiled in and forget about the configure difficulties for now (even though it's already been coded). > (ps. could you push yesterday's osdep_stub patch?) Done it now. I was waiting for your reply to Brad's comment, and forgot to apply it when I read it on my way to work. -- To unsubscribe, send mail to [email protected].
