On Thu, Jul 19, 2012 at 11:37:47AM -0400, Paul Wouters wrote:
> On Thu, 19 Jul 2012, Ian Goldberg wrote:
>
> >How's this for a proposed patch? [Paul, I think this addresses your
> >"magic numbers" concern as well.]
>
> It does, though I would have written:
>
> >+ /* Skip over the "?OTR:" */
> >+ otrtag += 5;
> >+ msglen -= 5;
>
> otrtag += sizeof("?OTR:")
> msglen -= sizeof("?OTR:")
>
> Then you don't even need the comment :)
But sizeof("?OTR:") is *6*, not 5, because of the NUL terminator. You
could use strlen() there, but I'm unconvinced about compilers
consistently optimizing away library calls.
- Ian
_______________________________________________
OTR-dev mailing list
[email protected]
http://lists.cypherpunks.ca/mailman/listinfo/otr-dev