aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-30 17:50:52 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-30 17:50:52 +0000
commit30a41632d36fe0d5b17ab2dec2b88c78f581714b (patch)
treee3e0d099d696b0aad9c905ea29e1c24fa843a983 /res
parent58a435db92fdaf4b3bd6373d04319472bbf57352 (diff)
More Solaris compatibility fixes
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@289543 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 7de717883..f7bc8d9cf 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -3029,11 +3029,20 @@ int AST_OPTIONAL_API_NAME(ast_agi_register)(struct ast_module *mod, agi_command
*((char **) &cmd->syntax) = ast_xmldoc_build_syntax("agi", fullcmd);
*((char **) &cmd->seealso) = ast_xmldoc_build_seealso("agi", fullcmd);
*((enum ast_doc_src *) &cmd->docsrc) = AST_XML_DOC;
-#elif (!defined(HAVE_NULLSAFE_PRINTF))
- *((char **) &cmd->summary) = ast_strdup("");
- *((char **) &cmd->usage) = ast_strdup("");
- *((char **) &cmd->syntax) = ast_strdup("");
- *((char **) &cmd->seealso) = ast_strdup("");
+#endif
+#ifndef HAVE_NULLSAFE_PRINTF
+ if (!cmd->summary) {
+ *((char **) &cmd->summary) = ast_strdup("");
+ }
+ if (!cmd->usage) {
+ *((char **) &cmd->usage) = ast_strdup("");
+ }
+ if (!cmd->syntax) {
+ *((char **) &cmd->syntax) = ast_strdup("");
+ }
+ if (!cmd->seealso) {
+ *((char **) &cmd->seealso) = ast_strdup("");
+ }
#endif
}
@@ -3802,15 +3811,18 @@ AST_TEST_DEFINE(test_agi_null_docs)
}
if (ast_agi_register(ast_module_info->self, &noop_command) == 0) {
+ ast_test_status_update(test, "Unable to register testnoop command, because res_agi is not loaded.\n");
return AST_TEST_NOT_RUN;
}
#ifndef HAVE_NULLSAFE_PRINTF
/* Test for condition without actually crashing Asterisk */
if (noop_command.usage == NULL) {
+ ast_test_status_update(test, "AGI testnoop usage was not updated properly.\n");
res = AST_TEST_FAIL;
}
if (noop_command.syntax == NULL) {
+ ast_test_status_update(test, "AGI testnoop syntax was not updated properly.\n");
res = AST_TEST_FAIL;
}
#endif