[svn-commits] trunk r31861 - /trunk/channels/chan_sip.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Sat Jun 3 16:03:30 MST 2006
Author: rizzo
Date: Sat Jun 3 18:03:29 2006
New Revision: 31861
URL: http://svn.digium.com/view/asterisk?rev=31861&view=rev
Log:
use ast_skip_blanks() where appropriate, and use standard
C jargoon *foo++ = '\0'; instead of two separate statements.
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=31861&r1=31860&r2=31861&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Sat Jun 3 18:03:29 2006
@@ -10163,8 +10163,7 @@
} else {
e = strchr(tmp, '@');
if (e) {
- *e = '\0';
- e++;
+ *e++ = '\0';
domain = e;
} else {
/* No username part */
@@ -11225,8 +11224,8 @@
char *sep;
if( (sep = strchr(event, ';')) ) { /* XXX bug here - overwriting string ? */
- *sep = '\0';
- eventid = ++sep;
+ *sep++ = '\0';
+ eventid = sep;
}
if (option_debug > 1 && sipdebug)
@@ -11291,27 +11290,20 @@
*/
if (option_debug > 2)
ast_log(LOG_DEBUG, "* SIP Transfer NOTIFY Attachment: \n---%s\n---\n", buf);
- cmd = buf;
- while(*cmd && (*cmd < 33)) { /* Skip white space */
- cmd++;
- }
+ cmd = ast_skip_blanks(buf);
code = cmd;
/* We are at SIP/2.0 */
while(*code && (*code > 32)) { /* Search white space */
code++;
}
- *code = '\0';
- code++;
- while(*code && (*code < 33)) { /* Skip white space */
- code++;
- }
+ *code++ = '\0';
+ code = ast_skip_blanks(code);
sep = code;
sep++;
while(*sep && (*sep > 32)) { /* Search white space */
sep++;
}
- *sep = '\0';
- sep++; /* Response string */
+ *sep++ = '\0'; /* Response string */
respcode = atoi(code);
switch (respcode) {
case 100: /* Trying: */
More information about the svn-commits
mailing list