RE: Octstr support for converting to and from HTML 4 entities.

"Oded Arbel" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
> -----Original Message-----
> From: Rene Kluwen [mailto:[email protected]]

> > strlen() does it faster.
> 
> 
> I am making an immutable octetstring, just for the sake of 
> not having to
> use strlen. Since I got commented before that the string 
> functions in C
> were a bad thing. There was no other reason. Change at will.

Oh. that was me - sorry. its no hard rule, but basicly what I meant is - don't use c strings for doing complicated stuff that the Octstr sub system handles better and more safely. do use c-string library calls for simple stuff that the library call would do better, especially if the call doesnot modify the content of the string (hence - no risk for buffer overflows). for example, when you want to compare octstrings you can use strcmp(octstr_get_cstr(.... or you can use octstr_compare(). this is the border line case IMO, where in this case I would have used the octstr_compare() as it involves fewer calls. you have already demonstrated that you can choose correctly between complexity and safety, and you can make the same decisions here. most importantly - don't take anything said by Kannel developers , especially me, as hard truth - those are simply recomendations. if we hate your code so much (not that I do) - we can change when it is in the CVS :-)

--
Oded Arbel
m-Wise mobile solutions
[email protected]

+972-9-9581711 (116)
+972-67-340014

::..
X windows:
        Putting new limits on productivity.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.