]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Changes some print statements/events to use a blank string in place of NULL if the...
authorJonathan Rose <jrose@digium.com>
Fri, 18 Mar 2011 16:19:05 +0000 (16:19 +0000)
committerJonathan Rose <jrose@digium.com>
Fri, 18 Mar 2011 16:19:05 +0000 (16:19 +0000)
This is supposed to improve Solaris compatibility since Solaris goes berserk when trying to output NULL strings.

(closes issue #18759)
Reported by: bklang
Patches:
      null-strings.patch uploaded by bklang (license 919)

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

channels/chan_sip.c
res/res_fax.c
res/res_jabber.c

index 7186d87d87d87e330af4887fdd4b45617430d536..9d9dacefb07aba67050c22aa15fff1477030de91 100644 (file)
@@ -23453,7 +23453,7 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
                if (!authpeer || AST_LIST_EMPTY(&authpeer->mailboxes)) {
                        transmit_response(p, "404 Not found (no mailbox)", req);
                        pvt_set_needdestroy(p, "received 404 response");
-                       ast_log(LOG_NOTICE, "Received SIP subscribe for peer without mailbox: %s\n", authpeer->name);
+                       ast_log(LOG_NOTICE, "Received SIP subscribe for peer without mailbox: %s\n", S_OR(authpeer->name, ""));
                        if (authpeer)
                                unref_peer(authpeer, "unref_peer, from handle_request_subscribe (authpeer 4)");
                        return 0;
index b39ef5daa77af4067bddd050033afcfbb62c5cb7..cc2ee5e2f3fd0ec6978b9e89ba202020f15ebe6d 100644 (file)
@@ -1764,11 +1764,11 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
                      info.context,
                      info.exten,
                      info.cid,
-                     pbx_builtin_getvar_helper(chan, "REMOTESTATIONID"),
-                     pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"),
-                     pbx_builtin_getvar_helper(chan, "FAXPAGES"),
-                     pbx_builtin_getvar_helper(chan, "FAXRESOLUTION"),
-                     pbx_builtin_getvar_helper(chan, "FAXBITRATE"),
+                     S_OR(pbx_builtin_getvar_helper(chan, "REMOTESTATIONID"), ""),
+                     S_OR(pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"), ""),
+                     S_OR(pbx_builtin_getvar_helper(chan, "FAXPAGES"), ""),
+                     S_OR(pbx_builtin_getvar_helper(chan, "FAXRESOLUTION"), ""),
+                     S_OR(pbx_builtin_getvar_helper(chan, "FAXBITRATE"), ""),
                      args.filename);
        ast_channel_unlock(chan);
 
@@ -2266,11 +2266,11 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
                      info.context,
                      info.exten,
                      info.cid,
-                     pbx_builtin_getvar_helper(chan, "REMOTESTATIONID"),
-                     pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"),
-                     pbx_builtin_getvar_helper(chan, "FAXPAGES"),
-                     pbx_builtin_getvar_helper(chan, "FAXRESOLUTION"),
-                     pbx_builtin_getvar_helper(chan, "FAXBITRATE"),
+                     S_OR(pbx_builtin_getvar_helper(chan, "REMOTESTATIONID"), ""),
+                     S_OR(pbx_builtin_getvar_helper(chan, "LOCALSTATIONID"), ""),
+                     S_OR(pbx_builtin_getvar_helper(chan, "FAXPAGES"), ""),
+                     S_OR(pbx_builtin_getvar_helper(chan, "FAXRESOLUTION"), ""),
+                     S_OR(pbx_builtin_getvar_helper(chan, "FAXBITRATE"), ""),
                      filenames);
        ast_channel_unlock(chan);
 
index a05e78f23425714169f8596d93f2e15dc4c68809..6a7e2274051268906c9e462f2254f38dd767ec7a 100644 (file)
@@ -2490,7 +2490,7 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak)
                        "Account: %s\r\nJID: %s\r\nResource: %s\r\nStatus: %d\r\nPriority: %d"
                        "\r\nDescription: %s\r\n",
                        client->name, pak->from->partial, found->resource, found->status,
-                       found->priority, found->description);
+                       found->priority, S_OR(found->description, ""));
        } else {
                manager_event(EVENT_FLAG_USER, "JabberStatus",
                        "Account: %s\r\nJID: %s\r\nStatus: %d\r\n",