[asterisk-dev] Re: trunk r19437 - /trunk/channels/chan_sip.c

Luigi Rizzo rizzo at icir.org
Wed Apr 12 00:51:24 MST 2006


On Wed, Apr 12, 2006 at 07:49:17AM +0000, Tony Mountifield wrote:
> In article <20060411235436.8A498A948E8 at abita.digium.internal>,
>  <svn-commits at lists.digium.com> wrote:
> > Author: rizzo
> > Date: Tue Apr 11 18:54:33 2006
> > New Revision: 19437
> > 
> > URL: http://svn.digium.com/view/asterisk?rev=19437&view=rev
> > Log:
> > remove useless \0, and fix formatting.
> > 
> > Modified:
> >     trunk/channels/chan_sip.c
> > 
> > Modified: trunk/channels/chan_sip.c
> > URL:
> > http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=19437&r1=19436&r2=19437&view=diff
> > ==============================================================================
> > --- trunk/channels/chan_sip.c (original)
> > +++ trunk/channels/chan_sip.c Tue Apr 11 18:54:33 2006
> > @@ -8882,11 +8882,12 @@
> >  	if (argc != 2) {
> >  		if (argc != 4) 
> >  			return RESULT_SHOWUSAGE;
> > -		else if (strncmp(argv[2], "ip\0", 3) == 0)
> > +		else if (strncmp(argv[2], "ip", 3) == 0)
> >  			return sip_do_debug_ip(fd, argc, argv);
> > -		else if (strncmp(argv[2], "peer\0", 5) == 0)
> > +		else if (strncmp(argv[2], "peer", 5) == 0)
> 
> In fact, they don't even need to be strncmp() either. A simple strcmp()
> will stop as soon as it gets to the end of one of the strings.
> 
> The third parameter to strncmp() above would only take effect if its
> value were less than the length of the second parameter.

in fact yes, i just did not know what the original author had in mind...

oej is currently working on the file, will look at it when he is done.

luigi
> Cheers
> Tony
> 
> -- 
> Tony Mountifield
> Work: tony at softins.co.uk - http://www.softins.co.uk
> Play: tony at mountifield.org - http://tony.mountifield.org
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev



More information about the asterisk-dev mailing list