[asterisk-commits] trunk r29234 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun May 21 16:54:29 MST 2006


Author: rizzo
Date: Sun May 21 18:54:28 2006
New Revision: 29234

URL: http://svn.digium.com/view/asterisk?rev=29234&view=rev
Log:
strcmp() is the right function to use here, not strncmp().
On passing simplify an ast_cli message nearby.


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=29234&r1=29233&r2=29234&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Sun May 21 18:54:28 2006
@@ -9362,19 +9362,16 @@
 	if (argc != 2) {
 		if (argc != 4) 
 			return RESULT_SHOWUSAGE;
-		else if (strncmp(argv[2], "ip", 3) == 0)
+		else if (strcmp(argv[2], "ip") == 0)
 			return sip_do_debug_ip(fd, argc, argv);
-		else if (strncmp(argv[2], "peer", 5) == 0)
+		else if (strcmp(argv[2], "peer") == 0)
 			return sip_do_debug_peer(fd, argc, argv);
 		else
 			return RESULT_SHOWUSAGE;
 	}
 	ast_set_flag(&global_flags[1], SIP_PAGE2_DEBUG_CONSOLE);
 	memset(&debugaddr, 0, sizeof(debugaddr));
-	if (oldsipdebug)
-		ast_cli(fd, "SIP Debugging re-enabled\n");
-	else
-		ast_cli(fd, "SIP Debugging enabled\n");
+	ast_cli(fd, "SIP Debugging %senabled\n", oldsipdebug ? "re-" : "");
 	return RESULT_SUCCESS;
 }
 



More information about the asterisk-commits mailing list