summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorLuigi Rizzo <rizzo@icir.org>2006-06-03 23:03:29 +0000
committerLuigi Rizzo <rizzo@icir.org>2006-06-03 23:03:29 +0000
commitec46b5a4ce9e6fe5cc2e68cb5fe70dee9e039cae (patch)
treec564963869eae2847fbab173d126237e963fce9f /channels
parentb7b716b61838faa1bf97f3812f82e104e8b44d34 (diff)
use ast_skip_blanks() where appropriate, and use standard
C jargoon *foo++ = '\0'; instead of two separate statements. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@31861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 3e97e884b..0f4a6b83c 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10163,8 +10163,7 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req)
} else {
e = strchr(tmp, '@');
if (e) {
- *e = '\0';
- e++;
+ *e++ = '\0';
domain = e;
} else {
/* No username part */
@@ -11225,8 +11224,8 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
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 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
*/
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: */