aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-03 21:02:51 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-03 21:02:51 +0000
commit9219fe2898bd796dfaa440a60dd78413de3ee494 (patch)
treed7b006cc53d1a0549605d0fb383f68cb794513c5 /channels/chan_iax2.c
parente3632070a9ccbe777f5da0f1c65564d59c31815b (diff)
use ast_strip_quoted to strip brackets from key secrets
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5835 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rwxr-xr-xchannels/chan_iax2.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 4dabea684..759fdb146 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -2877,13 +2877,8 @@ static void parse_dial_string(char *data, struct parsed_dial_string *pds)
move it to the key field instead
*/
if (pds->password && (pds->password[0] == '[')) {
- int len = strlen(pds->password);
-
- if ((len > 2) && (pds->password[len - 1] == ']')) {
- pds->key = ++(pds->password);
- pds->password[len - 1] = '\0';
- pds->password = NULL;
- }
+ pds->key = ast_strip_quoted(pds->password, "[", "]");
+ pds->password = NULL;
}
}