Hi! On Die, 2013-01-29 at 14:09 +0100, Alain Totouom wrote: [... fully agreed part omitted ... ] > How much space is enough space ;o) Enough is enough;-) In the above case it is pretty easy to predict - and the application (s programmer) must solve it anyways. > BTW pj_strdup2 allocates exactly six bytes, while > pj_strdup2_with_null allocates seven in this case. Yes, but that's not really relevant here as the base64-string is much longer. > IMHO the proposed "void pj_strcat3(pj_pool_t*,pj_str_t*,const > char*)" solution leans more to the PJ library programming style. Yes, that would fit more to the pjsip-string function design. On the other hand, strcat() also doesn't care about the allocation, though. Personally I miss more of a "pj_str_t pj_sprintf(pj_pool_t *, const char *fmt, ....);" which calculates and allocates the necessary memory from the given pool. Bernd -- mobile: +43 664 4416156 http://www.sysprog.at/ Linux Software Development, Consulting and Services