[Ecls-list] sockets.lisp and C++

Juan Jose Garcia-Ripoll jjgarcia at users.sourceforge.net
Tue Sep 26 08:14:55 UTC 2006


I have somehow fixed sockets.lisp to make it compile under C++.
In the process I found some code which look as follows

        struct sockaddr_un sockaddr;
	size_t size;
#ifdef BSD
        sockaddr.sun_len = sizeof(struct sockaddr_un);
#endif
        sockaddr.sun_family = #2;
        strncpy(&sockaddr.sun_path,#1,sizeof(sockaddr.sun_path));

I feel this is a bug because sockaddr.sun_path is C character array
with 108 elements and sockaddr.sun_path already returns the pointer to
the array. I have replaced the last line with

        strncpy(sockaddr.sun_path,#1,sizeof(sockaddr.sun_path));

But if somebody experiences problems, please tell me.

Juanjo




More information about the ecl-devel mailing list