On 13/11/15, 9:04 PM, "Dale R. Worley" <wor...@ariadne.com> wrote:

>Arun Arora <arun.arora....@gmail.com> writes:
>> Is their any specific length of To/ From header defined by the
>> standard (I guess not, but still would like to know other's views)
>
>As far as I can tell, your question is, "Is there a specific length
>defined from To/From headers?"  The answer to that is definitely not.
>
>> Currently the API signature is:
>>
>> iSipSessStart (char * psFrom, char *psTo);
>>
>> However, length is currently not known. Now, if I use strlen(), I
>> might be into trouble if the API user does not end the parameter with
>> NULL.
>
>What are the conventions of the programming language that you are using
>for passing variable-length string arguments?  If you're using "char *"
>arguments in C or C++, then the convention is to have the strings end
>with NUL (which isn't the same as NULL!), and that if the caller doesn't
>end the strings with NUL, the program may easily crash.

Hi Dale, The crash is exactly I am trying to avoid, plus I don’t want to rely 
on the API user to add NUL at the end. Yes, I am using char *

Thanks,
Arun

>
>Dale

_______________________________________________
Sip-implementors mailing list
Sip-implementors@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/sip-implementors

Reply via email to