]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't pass a value with a side effect to a macro
authorTerry Wilson <twilson@digium.com>
Tue, 13 Jan 2009 18:34:14 +0000 (18:34 +0000)
committerTerry Wilson <twilson@digium.com>
Tue, 13 Jan 2009 18:34:14 +0000 (18:34 +0000)
(closes issue #14176)
Reported by: paraeco
Patches:
      chan_sip.c.diff uploaded by paraeco (license 658)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168551 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 5d8ed871f01ca15f5cb4618e9617c55beb7283d6..004aaaabec744156b994f53839019c44c1e52f93 100644 (file)
@@ -7753,6 +7753,8 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
        }
 
        if ((fromdomain = strchr(r->username, '@'))) {
+               /* the domain name is just behind '@' */
+               fromdomain++ ;
                /* We have a domain in the username for registration */
                snprintf(from, sizeof(from), "<sip:%s>;tag=%s", r->username, p->tag);
                if (!ast_strlen_zero(p->theirtag))
@@ -7763,7 +7765,7 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
                /* If the registration username contains '@', then the domain should be used as
                   the equivalent of "fromdomain" for the registration */
                if (ast_strlen_zero(p->fromdomain)) {
-                       ast_string_field_set(p, fromdomain, ++fromdomain);
+                       ast_string_field_set(p, fromdomain, fromdomain);
                }
        } else {
                snprintf(from, sizeof(from), "<sip:%s@%s>;tag=%s", r->username, p->tohost, p->tag);