[sr-dev] char *s & int len --> to int (Kamailio code)

Iñaki Baz Castillo ibc at aliax.net
Thu Dec 30 13:16:29 CET 2010


Hi, when Kamailio/SER parses a number (like Content-Length value) I
assume it doesn't use atoi() or strol() C core functions as they are
too much flexible (allow negative values, hexadecimal notation) and
worse: they search until a char is not suitable for an integer/long. A
bit dangerous as when parsing a stream we don't know if the next
position in memory contains a digit or not.

So could I be pointed to the exact function in Kamailio/SER code
converting the Content-Length string value (pointer + lentgh) to an
integer?

Thanks a lot.

-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-dev mailing list