In article <[EMAIL PROTECTED]>,
 <[email protected]> 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.

Cheers
Tony

-- 
Tony Mountifield
Work: [EMAIL PROTECTED] - http://www.softins.co.uk
Play: [EMAIL PROTECTED] - 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

Reply via email to