Re: libesmtp-1.0.2 bug and patch for FreeBSD
John Merryweather Cooper <[email protected]> Wed, 21 Jan 2004 09:45:24 -0800
| Newsgroups | gmane.comp.lib.libesmtp |
|---|---|
| Message-ID | <[email protected]> |
Brian Stafford wrote: > On 2004.01.19 19:46, Pawel Salek wrote: > >> On 01/20/2004 07:48:27 PM, John Merryweather Cooper wrote: >> >>> Version 1.0.2 works after a little hacking on FreeBSD: >>> >>> Patch: patch-smpt-tls.c >>> >>> FreeBSD does not have a memrchr() [not POSIX] and so a home-grown >>> one is cobbled into the code with the patch. FreeBSD does have a >>> strrchr() for C-strings. >> >> >> Wouldn't it be the best to use strrchr() throughout entire code then? > > > The components of the domain name are compared right to left. The dots > in the string containing the domain name would have to be overwritten > with nul characters for strrchr() to be useful in this context, or a > special purpose function written. Better to use something else (at > least mostly standard) from the C library. > > Brian > _______________________________________________ > libesmtp-devel mailing list > [email protected] > http://community.uklinux.net/mailman/listinfo/libesmtp-devel > Using the strsep() or strtok() functions, replacing the dots with NULs, or separating the components would be very easy to do. strtok() is ANSI and should always be available. strsep() is a more programmer friendly interface than strtok(). jmc