[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guile segfault with network calls
From: |
Gary Houston |
Subject: |
Re: Guile segfault with network calls |
Date: |
3 Mar 2001 16:01:04 -0000 |
> Date: Sat, 3 Mar 2001 14:50:18 +0100 (MET)
> From: Dirk Herrmann <address@hidden>
>
> > soka->sun_family = AF_UNIX;
> > - SCM_ASSERT (SCM_STRINGP (address), address, which_arg, proc);
> > memcpy (soka->sun_path, SCM_STRING_CHARS (address),
> > - 1 + SCM_STRING_LENGTH (address));
> > - *size = sizeof (struct sockaddr_un);
> > + SCM_STRING_LENGTH (address) + 1);
>
> ^^^ Is this necessary?
> (It will only copy a null byte, which is already created by memset.)
No, it's not needed. Better to omit it I guess, then no need to worry
about how address is terminated.
> > + *size = SUN_LEN (soka);
> > return (struct sockaddr *) soka;
> > }
> > #endif
>
> Nice trick. (Please note my comment above.)
I guess I'll commit it shortly, along with a bunch of other fixes to this
socket.c file.