[OpenSER-Devel] SF.net SVN: openser: [3156] trunk/modules/permissions/mi.c

Dan Pascu dan at ag-projects.com
Fri Nov 16 14:17:46 UTC 2007


On Friday 16 November 2007, Henning Westerholt wrote:
> On Friday 16 November 2007, Dan Pascu wrote:
> > Revision: 3156
> >          
> > http://openser.svn.sourceforge.net/openser/?rev=3156&view=rev Author:
> >   dan_pascu
> > Date:     2007-11-16 04:45:39 -0800 (Fri, 16 Nov 2007)
> >
> > Log Message:
> > -----------
> > Fixed length of string constants. This should be better done by
> > #define-ing some constants and using sizeof(constant)-1 on them.
>
> Hi Dan,
>
> even better would be to let mi_init_tree calculate the string length,
> and avoid this manual and error-prone initialization. The small runtime
> overhead is negligible, as the fifo commands are not performance
> critical.
>
> Just an idea - best regards,

I agree. I see no real reason to pass both the string and its length as 
they are string constants statically defined in the code, not parts 
obtained from a str by processing (in which case a pointer and a length 
would be useful). In this case a simple char pointer would be enough and 
the mi module can compute the len using strlen on it.

But this change is too big for 1.3

-- 
Dan



More information about the Devel mailing list