diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-20 17:01:03 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-20 17:01:03 +0000 |
commit | bbd60b12e592138fe3eaa7dd84dc44728f6fc32a (patch) | |
tree | 5231e2949e711460bad52991be3e592388238354 | |
parent | 4b3b9331c42bfd597e568c46f8ee67fe535f3cb8 (diff) |
fix reply_digest breakage from earlier patch
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5941 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | channels/chan_sip.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 221402234..31391c4d2 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -7772,29 +7772,24 @@ static int reply_digest(struct sip_pvt *p, struct sip_request *req, i->dst[0] = '\0'; /* init all to empty strings */ while (c && *(c = ast_skip_blanks(c))) { /* lookup for keys */ for (i = keys; i->key != NULL; i++) { - char *src; + char *src, *separator; if (strncasecmp(c, i->key, strlen(i->key)) != 0) continue; /* Found. Skip keyword, take text in quotes or up to the separator. */ c += strlen(i->key); - if ((*c == '\"')) { + if (*c == '\"') { src = ++c; - if ((c = strchr(c,'\"'))) { - *c = '\0'; - c++; - } + separator = "\""; } else { src = c; - if ((c = strchr(c,','))) { - *c = '\0'; - c++; - } + separator = ","; } + strsep(&c, separator); /* clear separator and move ptr */ ast_copy_string(i->dst, src, i->dstlen); break; } - if (i->key == NULL) - c = strchr(c,','); + if (i->key == NULL) /* not found, try ',' */ + strsep(&c, ","); } /* Save auth data for following registrations */ |