[ccan] [PATCH 2/2] Add rfc822 module for parsing emails

David Gibson david at gibson.dropbear.id.au
Sun Jun 10 02:13:53 EST 2012


On Sat, Jun 09, 2012 at 10:34:39AM -0500, Jonathan Nieder wrote:
> David Gibson wrote:
> 
> > +struct bytestring rfc822_body(struct rfc822_msg *msg)
> > +{
> [...]
> > +	if (!msg->body && msg->remainder) {
> > +		p = memmem(msg->remainder, msg->end - msg->remainder,
> > +			   "\r\n\r\n", 4);
> > +		if (p) {
> > +			p += 4;
> > +		} else {
> > +			p = memmem(msg->remainder, msg->end - msg->remainder,
> > +				   "\n\n", 2);
> 
> Still scary. :)

Oops, forgot to go back and fix that one.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson


More information about the ccan mailing list