[OTR-dev] Typo error in otrl_context_forget function?

k007k k007k at wp.pl
Tue Sep 16 14:33:27 EDT 2014

Hi all,

While debugging my plugin, I came across the following code in context.c:

/* Forget a whole context, so long as it's PLAINTEXT. If a context has child
  * instances, don't remove this instance unless children are also all in
  * PLAINTEXT state. In this case, the children will also be removed.
  * Returns 0 on success, 1 on failure. */
int otrl_context_forget(ConnContext *context)
     if (context->msgstate != OTRL_MSGSTATE_PLAINTEXT) return 1;

     if (context->their_instance == OTRL_INSTAG_MASTER) {
         ConnContext *c_iter;

         for (c_iter = context; c_iter &&
                 c_iter->m_context == context->m_context;
                 c_iter = c_iter->next) {
             if (context->msgstate != OTRL_MSGSTATE_PLAINTEXT) return 1;

I think the last if statement should check c_iter->msgstate instead of context->msgstate.


More information about the OTR-dev mailing list