Re: Trying to compile cwm on Linux

2008-08-01 Thread Martin Toft
On Thu, Jul 24, 2008 at 10:35:36PM +0200, Martin Toft wrote: On Thu, Jul 24, 2008 at 02:20:22PM -0600, Theo de Raadt wrote: +#define strlcpy(dst, src, size) (strncpy((dst), (src), (size) - 1)) +#define strlcat(dst, src, size) (strncat((dst), (src), (size) - 1)) That is utterly and

Re: Trying to compile cwm on Linux

2008-07-24 Thread Martin Toft
On Wed, Jul 23, 2008 at 10:55:01PM +0200, Martin Toft wrote: I'm trying to compile cwm (/usr/xenocara/app/cwm) on Linux, as I would like to use this very supreme window manager on all my non-OpenBSD systems as well. The version of cwm that I'm working with is from yesterday's -current (23rd of

Re: Trying to compile cwm on Linux

2008-07-24 Thread Theo de Raadt
+#define strlcpy(dst, src, size) (strncpy((dst), (src), (size) - 1)) +#define strlcat(dst, src, size) (strncat((dst), (src), (size) - 1)) That is utterly and completely wrong.

Re: Trying to compile cwm on Linux

2008-07-24 Thread Pierre-Yves Ritschard
6. Compile and link: $ for i in *.c; do gcc -I /usr/include/freetype2 -c $i; done $ gcc -lXft -lXrender -lX11 -lXau -lXdmcp -lXext -lfontconfig -lexpat -lfreetype -lz -o cwm *.o Most linux distributions carry a pmake package which provides the a bsd.prog.mk and thus support for the

Re: Trying to compile cwm on Linux

2008-07-24 Thread Marc Espie
On Thu, Jul 24, 2008 at 10:01:50PM +0200, Martin Toft wrote: +#define strlcpy(dst, src, size) (strncpy((dst), (src), (size) - 1)) +#define strlcat(dst, src, size) (strncat((dst), (src), (size) - 1)) To be a bit more specific than Theo, don't believe idiots like Ulrich Drepper. There's a

Re: Trying to compile cwm on Linux

2008-07-24 Thread Martin Toft
On Thu, Jul 24, 2008 at 02:20:22PM -0600, Theo de Raadt wrote: +#define strlcpy(dst, src, size) (strncpy((dst), (src), (size) - 1)) +#define strlcat(dst, src, size) (strncat((dst), (src), (size) - 1)) That is utterly and completely wrong. Yep, I'm a noob when it comes to these kinds of

Re: Trying to compile cwm on Linux

2008-07-24 Thread Miod Vallat
+#define strlcpy(dst, src, size) (strncpy((dst), (src), (size) - 1)) +#define strlcat(dst, src, size) (strncat((dst), (src), (size) - 1)) strlcpy() and strlcat() return size_t. strncpy() and strncat() return char *. These #define do not take care of this (among other things).