pj_strcat problems...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Thank you for getting back to me. Should I allocate some space from the 
pool for the two pj_str variables? I assumed that the pjsua library 
would do that for me.

BR

Steven


On 01/25/2012 01:48 PM, Hari Narayanan wrote:
> Yes, I copied and executed your code. I see seg fault on Windows XP. 
> The memcpy corresponding to pj_strcat is trying to copy characters 
> from argv[1] to where it is not supposed to. I do not see any memory 
> alloction preceding memcpy.
> Hari
>
> On Wed, Jan 25, 2012 at 4:44 PM, sjs205 <sjs205.linux at gmail.com 
> <mailto:sjs205.linux at gmail.com>> wrote:
>
>     Hello all,
>
>     It is probably just me being stupid - I am fairly new to C and
>     pjsip so go easy on me - but I'm having some problems with the
>     pj_strcat function. The following file just segfaults, can anyone
>     tell me why?:
>
>     #include <pjsua.h>
>     int main(int argc, char *argv[])
>     {
>            const pj_str_t sip_user = pj_str(argv[1]);
>            pj_str_t tmp = {"sip:",4};
>
>            pj_strcat(&tmp, &sip_user);
>
>            printf("STRING: %s ***", tmp);
>        return 0;
>     }
>
>     BR
>
>     Steven
>
>
>     _______________________________________________
>     Visit our blog: http://blog.pjsip.org <http://blog.pjsip.org/>
>
>     pjsip mailing list
>     pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org>
>     http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120125/2f5568c7/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux