@@ 42,6 42,10 @@ int sip_parse_register_line(struct sip_registry *reg, int default_expiry, const
char buf[256] = "";
char *userpart = NULL, *hostpart = NULL;
/* register => [peer?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry] */
+ AST_DECLARE_APP_ARGS(pre0,
+ AST_APP_ARG(pre0userpart);
+ AST_APP_ARG(pre0hostpart);
+ );
AST_DECLARE_APP_ARGS(pre1,
AST_APP_ARG(peer);
AST_APP_ARG(userpart);
@@ 95,10 99,9 @@ int sip_parse_register_line(struct sip_registry *reg, int default_expiry, const
* userpart => [peer?][transport://]user[@domain][:secret[:authuser]]
* hostpart => host[:port][/extension][~expiry]
*/
- if ((hostpart = strrchr(buf, '@'))) {
- *hostpart++ = '\0';
- userpart = buf;
- }
+ AST_NONSTANDARD_RAW_ARGS(pre0, buf, '@');
+ hostpart = pre0.pre0hostpart;
+ userpart = pre0.pre0userpart;
if (ast_strlen_zero(userpart) || ast_strlen_zero(hostpart)) {
ast_log(LOG_WARNING, "Format for registration is [peer?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry] at line %d\n", lineno);