[OpenSIPS-Devel] uri->host.s problem when using parse_from_uri

Alejandro Rios P. alerios at debian.org
Thu Apr 14 02:29:21 CEST 2011


Thank you Andrew, it worked great :)


Alejandro Rios



2011/4/13 Andrew Mortensen <admorten at isc.upenn.edu>

>
> On Apr 13, 2011, at 6:57 PM, Alejandro Rios P. wrote:
>
> > Hi All,
> >
> > I've been playing a little bit with the source code of 'closeddial'
> module (v1.6.2), and I'm having an issue with the 'parse_from_uri' function:
> >
> > ...
> >
> > 3. Then, I'm trying to use the 'host' part:
> > ...
> >                 LM_DBG("Comparing domain %s\n", from_uri->host.s);
> >         }
> >
> >
> > 4. But when running using debug, I'm getting not only the host part, but
> everything else in the rest of the message:
>
> The "s" field isn't null terminated. You need to use the special %.*s
> placeholder for str variables:
>
> LM_DBG("Comparing domain %.*s\n", from_uri->host.len, from_uri->host.s);
>
> andrew
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20110413/228a1da6/attachment.htm>


More information about the Devel mailing list